Тёмный

VBA to fill out PDF Forms - VBA PDF Automation-6 

VBA A2Z
Подписаться 51 тыс.
Просмотров 23 тыс.
50% 1

Friendly tutorial to Automate PDF using real-world scenarios using VBA and PDF API.
More resources: vbaa2z.blogspot.com/2020/01/v...
Subscribe, Like, and Comment. 🙏Thanks for watching.
You can now support by buying any of the Projects or Source Code.
📥Downloads: pamaitech.com/downloads/
👍 Support: paypal.me/pamaitech
✉️ Contact: contact@pamaitech.com
📌What to watch next:
Playlist: ru-vid.complaylists
Videos: ru-vid.comvideos
#VbaA2z

Наука

Опубликовано:

 

15 янв 2020

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 59   
@maxopli
@maxopli 3 года назад
Thank you for such an useful tutorial! I was wondering if there would be anyway to declare and set the variables for the fields automatically. For example, would there be a way to do "Dim first_name as AFORMAUTLib.field" and "Set first_name = pdf_form.Fields("First Name_pp0X..." automatically? I was thinking maybe using an array of numbers to declare fields (such as Dim 1,2,3... as AFORMAUTLib.field) feature and some sort of a loop. Since you have the field names from the pdf on Sheet4, I feel like there could be away to do so. I'm ultimately asking this question because I have multiple pdfs with different fields names and a lot of fields to copy the data from Excel. So wondering if there is an easier way of doing so.
@VBAA2Z
@VBAA2Z 3 года назад
Yes you can. something like this Dim PDFfields() as AFORMAUTLib.field ReDim PDFfields(FieldsCount) as AFORMAUTLib.field PDFfields(0) = pdf_form.Fields(x)
@SiLiDNB
@SiLiDNB 2 месяца назад
Thank you so much! This helped me solve a different case :) I owe you
@VBAA2Z
@VBAA2Z 2 месяца назад
You are welcome!
@user-fp4mh2ki7c
@user-fp4mh2ki7c Год назад
Thank you very much Sir for sharing your wonderful work.
@VBAA2Z
@VBAA2Z Год назад
You're most welcome!
@bradbenner4204
@bradbenner4204 3 года назад
Great video. Thank you. Is there a way to programically get the radio button choices from a group of radio buttons?
@VBAA2Z
@VBAA2Z 3 года назад
Thanks for watching. Below videos including this are related to a pdf form. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-ueOVzFnE-08.html ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-v-uxpc86wrw.html ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-zL-s8qHYBpE.html
@mrcfmoftheworld
@mrcfmoftheworld 3 года назад
Many thanks for the great work. I was wondering if you have any ideas about working with images in PDF files through vba? Much appreciated.
@VBAA2Z
@VBAA2Z 3 года назад
You're welcome Hussein, if you're talking about attaching images using browse button in PDF form or extracting image content in form there should be API for that too. I haven't attempted personally.
@roland9923
@roland9923 4 года назад
Please do one more video on how to fill a PDF forms using the data in excel. Thank you, this is very useful.
@Spartipilo
@Spartipilo Год назад
Instead of setting name = "Kimberly", set name = CSTR(Range("A2").Value)
@alexcalangi1362
@alexcalangi1362 4 года назад
Is it possible to create a VBA Macro that takes information from the spreadsheet into a form online? Would love to see a video on that!
@VBAA2Z
@VBAA2Z 4 года назад
This is how you can approach it. Think about the userid/email and password fields as your form fields. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-4ebheN9midA.html
@user-ex2tl3go9b
@user-ex2tl3go9b 4 года назад
Is it possible to stamp on the pdf attachments using outlook macro ?
@VBAA2Z
@VBAA2Z 4 года назад
Yes you can use the API to accomplish the same.
@user-ll8up1eu4d
@user-ll8up1eu4d Год назад
Great video
@VBAA2Z
@VBAA2Z Год назад
Thanks for the visit
@wellinformed8050
@wellinformed8050 3 года назад
Hello, I have a question. Is it possible to fill in multiple seperate pdf forms from excel and make it apply to all the seperated pdf forms?
@VBAA2Z
@VBAA2Z 3 года назад
Not sure i understand. If you're looking dynamically fill pdf forms using different excel rows, the answer is yes
@johnclark851
@johnclark851 2 года назад
Excellent tutorial, works like a charm for me except for radio buttons and checkboxes. All the texts fields save just fine but the other field types will not. What is even more strange is that I can halt the code BEFORE it saves and SEE my changes, but as soon as I close the form - doesn't matter what I do, Save, Save As, Save As Other - it fields revert back to the original values. Any ideas?
@VBAA2Z
@VBAA2Z 2 года назад
Thanks for visit. The issue seems strange. Are you able to manually full the form the save it / save as? if yes you should be able to programmatically
@johnclark851
@johnclark851 2 года назад
@@VBAA2Z I cannot. It will allow me to do a Save, Save As, Save As Copy...just about anything...except when I open it up afterwards, the only thing saved are the text fields. Very strange indeed.
@wiliiamtanuji2125
@wiliiamtanuji2125 2 года назад
Very helpful. Can the code work without Adobe Acrobat Pro? Because my current target pdf form only allows users to use Acrobat Reader 32x bit to open the pdf. If we use Adobe Acrobat Pro, it will give warnings to the users when we open it.
@VBAA2Z
@VBAA2Z 2 года назад
this video demo how to use Adobe Acrobat API so yes. More videos/options in below playlist ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-uc6palG76Y8.html
@SunriseSearcher
@SunriseSearcher 4 года назад
Do you have to Reference something or have something installed to be able to use this like an Adobe Library?
@VBAA2Z
@VBAA2Z 4 года назад
You'll have to reference it to Adobe Acrobat Lib. Please check below link for the full course. ru-vid.com/group/PLo0aMPtFIFDqfrLJUuIkP2lrOkchJf11m
@nickc-b6460
@nickc-b6460 3 года назад
The required references are Adobe Acrobat 10.0 Type Library & AFormAut 1.0 Type Library. Adobe Acrobat 10.0 Type Library was not available in my references (assuming this could be an issue for other people). I was able to retrieve it by clicking Browse on the vba references window and navigating to C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader and selecting Acrord32Res.dll
@oleksiimazur4336
@oleksiimazur4336 3 года назад
@@nickc-b6460 thanks a lot ! did you have a pro version of Acrobat or standard? I have a standard and the code is not working...
@MiniBoomKat
@MiniBoomKat 4 года назад
Thanks, this helped a lot. The code stops at the if statement for saving the file. Is there another way to save an open pdf?
@botforce365cognitiverpa7
@botforce365cognitiverpa7 3 года назад
Can I do similar thing in either VB.NET or C#.NET?
@VBAA2Z
@VBAA2Z 3 года назад
Yes you can. try Stackoverflow / google for relevant packages.
@massimoguillory3822
@massimoguillory3822 3 года назад
Does it autofill check box?
@VBAA2Z
@VBAA2Z 3 года назад
Try obj.value = true ' to check obj.value = False ' to uncheck or obj.checked = 1 ' to check obj.checked = 0 ' to uncheck
@dott.helmutalzheimer618
@dott.helmutalzheimer618 4 года назад
Hi i have a problem with AFORMAUTLib...it's not defined by user Why ? please help. It's possible that is not in the system....whare i can found it?
@VBAA2Z
@VBAA2Z 4 года назад
Please ensure you've Acrobat Installed. Please check below link for full video. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-uc6palG76Y8.html vbaa2z.blogspot.com/2020/01/vba-pdf-automation-read-write-extract.html
@dott.helmutalzheimer618
@dott.helmutalzheimer618 4 года назад
@@VBAA2Z I have Acrobat Reader DC....do i need adobe acrobat Dc for this? P.S. I have already see the full video, please help
@Angelica1905ki
@Angelica1905ki 2 года назад
@@dott.helmutalzheimer618 Yes
@user-hn6em7pj5e
@user-hn6em7pj5e Год назад
is it Possible To insert img sous form PDF en Autofill Form ? you know what i mean ?
@VBAA2Z
@VBAA2Z Год назад
yes, you can
@abdulsafwan4419
@abdulsafwan4419 3 года назад
Is that possible to print form without pdf form ( as normal pdf file)
@VBAA2Z
@VBAA2Z 3 года назад
I haven't tried that myself. might want to try it out and let me know if it doesn't work
@abdulsafwan4419
@abdulsafwan4419 3 года назад
@@VBAA2Z i tried but special special characters are not working
@frederickchristian5676
@frederickchristian5676 3 года назад
This worked perfectly for weeks and then suddenly it had stopped recently even though I didn't change anything. Now I'm getting this automation error saying element not found with a run-time error -2147319765 (8002802b), do you know what the issue is? I had kept everything the same when it decided not to work anymore. It occurs when writing to PDF at Set first_name = pdf_form.Fields("the field name")
@VBAA2Z
@VBAA2Z 3 года назад
element not found seems like the field was not found. try printing back field names and confirm nothing have changed in source. does it set ok for other fields?
@frederickchristian5676
@frederickchristian5676 3 года назад
@@VBAA2Z it previously did but now it just doesnt want to work and i hadnt touched the name of the fields in the code or the pdf form. I comment out each line and I just end up with the same issue in the next field. It ends up as pdf_form.Fields("Name") =
@VBAA2Z
@VBAA2Z 3 года назад
Try clearing cache and temp files from your pc, re-start your pc and try again. Also if your pdf is protected you'll need to get pass that to refer to fields.
@frederickchristian5676
@frederickchristian5676 3 года назад
@@VBAA2Z sadly it led to the same issue. Any advice from here?
@VBAA2Z
@VBAA2Z 3 года назад
try posting the same question in stackoverflow.com/ in case others faced the same issue. I have encountered Automation Error while working with SharePoint using VBA and I fixed it by preparing my office. It might be worth trying it in another PC it works there it'll confirm something is wrong from your office app / acrobat library
@abdulwahedcatran8349
@abdulwahedcatran8349 4 года назад
Thank you so much How can I add an image to the image field in a PDF using vba?
@VBAA2Z
@VBAA2Z 4 года назад
I'll check and come back to you asap
@rarehuman
@rarehuman 2 года назад
@@VBAA2Z hi there, this was super interesting and i came up with this question too. Have you had a chance to look into adding an image into the pdf form from a given path?
@r.a.8618
@r.a.8618 3 года назад
Does not work. There is no instruction on what reference library you used in this tutorial. Go "Compile-Error: User-defined Type not defined" at "Dim pdf_form As AFormAutLib.AFormApp". Seems like your method does not work with Adobe Acrobat 10.0 Type Library which I'm using. Other examples I found online use "Dim pdfApp As *Acrobat.CAcroApp*" instead of "Dim pdfApp As *Acrobat.AcroApp*". What's the difference? Actually I'm stuck at pdfDoc.Save(PDSaveFull, "C:\VBA\Test.pdf"). No idea why it's not saving.
@Angelica1905ki
@Angelica1905ki 2 года назад
You need to reference the AFormAut 1.0 library in addition to Adobe Acrobat 10.0 Type library
@DieTabbi
@DieTabbi Год назад
:-( so you create the pdf within Excel and not use existing pdf to fill in form fields.
@VBAA2Z
@VBAA2Z Год назад
Form is created using Acrobat
Далее
Automated Invoice System | Excel VBA Project
46:09
Просмотров 29 тыс.
Fill PDF Form with excel data
10:04
Просмотров 6 тыс.
iPhone перегрелся, что делать?!
1:01
Так ли Хорош Founders Edition RTX 4080 ?
13:00