PDA

View Full Version : Solved: Calling Acrobat 5.0 from Word to save as PDF



LukeA
01-05-2006, 02:30 AM
Hi guys,

I found a post on the forum from a while ago that showed how to save a document and then convert it to PDF saving it as the same file name.

There was an error in the line of code that a few people in the post spotted, but the author didn't show any replacement code.
I've tried searching on Google, within the forum and others, but can't find the best way of doing this.

At the moment, my code is;



Documents(1).SaveAs TempDocs & "\" & strOrderNum & "-" & strProdCode & "_" & strBatch
ActivePrinter = "Acrobat Distiller"
ActiveDocument.PrintOut


Basically I am saving the file using parameters within the word document. It then prints out to the acrobat distiller printer.

If I check "View result in Acrobat" in the printer properties, I can manually save the PDF, but I need this to be automated, with the same name and save in the same folder as the word doc.

Any ideas?

Regards,
Luke

lucas
01-05-2006, 11:31 AM
Hi Luke,

Sorry I don't have time right this moment to give this more attention but I'm in the middle of a family crisis(Mother terminally ill). I will put a link here to the other post so that maybe Joanne or some of the other very capable people here might give you a hand with this.

I did not follow through with the automation of this because I don't save pdf's very often and when I do I like to have control over where they go when saved. Also I only have a pdf printer driver, not the actual distiller so they would be more likely to help with that. I got your pm by the way.

Link to original post (http://www.vbaexpress.com/forum/showthread.php?t=384&highlight=acrobat)

LukeA
01-06-2006, 09:55 AM
Thanks Steve - sorry I pm'ed you as well, after doing so thought was best to put a new post in the forum in case Joanne picked up on it.

Hopefully someone can answer this. To add to my original post, I have a word doc saved in code, and I then need to save it as a pdf with the same file name. It needs to be automatic because it will be running on the server with no user interaction. (I have another program working which picks up the pdf, and attaches it to an email, and sends automatically).

Thanks for the help guys'n'gals, have a good weekend.
Luke

LukeA
01-09-2006, 06:58 AM
Figured it out.

Didn't realise that Adobe actually saved a copy of the file that goes to print anyway!

All I did was create a new printer port, and set this to the folder location I needed the pdf's to be saved as. There is a port called pdf port - I added a new one of these to the Acrobat Distiller printer, and set to c:\temp.

Then on the printer settings, unchecked "Require Filename" and "View results in Reader" as Joanne had stated in the other post, and now works as required.

Luke

Ken Puls
01-09-2006, 09:26 AM
Hi Luke,

Can you mark this one as solved?

:)