PDA

View Full Version : Solved: Save word document as pdf in VBA for free?



rsimm
11-27-2008, 04:32 AM
Is there a free way to save a word document as a pdf using VBA, that doesn't require Adobe Distiller or another paid-for solution?

Nelviticus
11-27-2008, 05:39 AM
You can install one of the many free PDF printers and use VBA to print to them, just like you would to any other printer.

rsimm
11-28-2008, 02:49 AM
thanks. can you recommend one? I need one where you can programatically set the pdf filename and path

Nelviticus
11-28-2008, 03:33 AM
I can't recommend a free one but I have used a very very cheap one called Universal Document Converter (http://www.print-driver.com/). It needed a bit of setting up but it gives the PDFs the same name as the Word documents you print to it. Thus, in a roundabout way, you can programmatically set the name and path of your PDF. Before you start you manually configure the (fake) printer settings with the path, then use VBA to save your Word doc with the right file name and print it to the UDC printer.

That was the best and cheapest solution I could find at the time - there may be better ones out there but I didn't have time to do extensive research.

TonyJollans
11-28-2008, 10:00 AM
What version of Word? Word 2007 can use Microsoft's free AddIn to do this.

Alternatively, PDFCreator (free from http://sourceforge.net/projects/pdfcreator/) can be used in VBA. Ken Puls has several articles about it on his site (www.ExcelGuru.ca)

rsimm
11-29-2008, 11:42 AM
Using Word 2003. Many thanks for those links Nelviticus and Tony, I really appreciate you taking the time to respond.