Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to convert MS Word files into PDF via VBA?

Status
Not open for further replies.

sudakov

Programmer
Jun 17, 2007
53
US
Hello,
I have multiple (hundreds) MS Word files in a folder.
I would like to write VBA code to convert them into respective PDF files.

Does anybody know if this is possible?
Has anyone done it before?

Thanks.
Sudakov.
 
Duane,
the reason I asked my question in Access forum is that I plan to incorporate the code into a MS Access application.
However, I have followed your advise and re-posted it in forum707: VBA Visual Basic for Application (Microsoft).

Genomon,
sorry I forgot to mention I use MS Access 2003 where export to PDF (acFormatPDF) is not available, unlike MS Access 2007.
The article tells how to export a REPORT into PDF, not a MS Word file.

Thank you both for your replies.
 
Unfortunate about the Access version; the VBA works the same in Word with different param constants however.

An làmb a bheir, ‘s i a gheibh.
 
Genomon,
I see what you mean and correct me if I am wrong - you suggest to execute VBA code from MS WORD 2007.
However, MS Office 2007 is not available in my work environment yet.

Thank you.
 
Yup. There are some 3rd party libs out there to write PDFs in VBA; we used to use the ACG Pdf & Email lib. Or if you own the PDF Writer (full version, not reader) you can set a project reference in the VBA IDE. I never found much for VBA samples though, and Acrobat doesn't really support the VBA stuff - they seem to love Java though as there are lots of samples for that on the Adobe website. Otherwise if you are able to set the lib reference you can cruise around in object browser & see what works for you.

An làmb a bheir, ‘s i a gheibh.
 
Hi genomon,
thank you.

I let you know if I can figure it out myself how to use Adobe's API.

Thanks.
Sudakov.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top