Creating PDF files automatically

M

Mike Phelps

I am trying to use VBA to create some PDF files from a Word (2000) document
with Acrobat 5.0. Each time I run my procedure I get a Save As dialog box
and I have to enter a file name and click

I initially used the macro recorder and have used both this code, generated
from the Acrobat button on the toolbar:
Application.Run MacroName:="AdobePDFMakerA.AutoExec.ConvertToPDF"
And also printing to the Acrobat Distiller:
ActivePrinter = "Acrobat Distiller"
Application.PrintOut filename:="", Range:=wdPrintAllDocument, Item:=
wdPrintDocumentContent, Copies:=1
I have then tried using SendKeys to get rid of the box automatically but it
doesn't work.

Can anyone tell me how to pass a filename to this Save As box and get it to
save automatically.

Thanks
 
M

Mark Tangard

Mike,

I've had the same frustration. I don't have it in front of me,
but there's an Acrobat setting that you reach by way of Word's
Print dialog (maybe in "Properties" once you've selected the
Distiller). It's a checkbox labeled "Prompt for PDF Filename."
Clear that checkbox and your PDF is birthed without the pause.

One annoyance: Because it doesn't ask you for a filename, it
doesn't ask you for a folder either, so the PDFs go the folder
to which you last printed *explicitly* during that session.
If you don't do a dummy explicit print first to brand that
folder into Acrobat's brain, a fresh instance of Acrobat will
prefer to save PDFs to the *Desktop* instead of to an ordinary
folder -- not ideal if you occasionally need to batch-print 75
PDFs like I do.)

I find Acrobat's 'Preferences' dialog almost as badly designed
as Word Tools­>Options. If you or anyone else knows how to set
Distiller's output folder, please yell.
 
M

Mike Phelps

Mark

Thanks for the response. I've adjusted the properties and I no longer get
the
prompt to save. However, can I ask you if you know of a way to make these
changes stick or to automate them in VBA. Each time I open the file the
Acrobat Distiller properties are back to what they were.

Also can you tell me how I can do a dummy explicit, as you called it, so
that
the folder I want to use to save the files in is selected.

Thanks again.
 
M

Mark Tangard

No, not a clue. That's why my last line asks if anyone does
know now. Probably the prompt is actually coming from Acrobat
rather than Word, so VBA can't answer it. ;(

To do a dummy explicit print, just find that same checkbox and
re-check it, then do a print to Distiller, which *will* prompt
for the folder & filename. Be sure to give that one the folder
you want. Then *without* closing Word, go back to the checkbox,
uncheck it, and run your mass prints. (Once you close Word it's
all back to square one....)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top