How to add filename for Acrobat printout?

G

Gary Burton

I am using Excel 2003.

I am trying to output a print area from my spreadsheet to a PDF file, but I
can't seem to find a way to automatically or even semi-automatically specify
the filename. I generate the path and filename in Excel.

I tried the PrintToFile option of the Printout method, but it wound up
prompting me to disable a font feature in Acrobat. I got cold feet at that
point because of the sensitivity to changing settings in my work
environment. I'm not sure PrintToFile would get me PDF anyway.

Since I couldn't find a way to automatically enter the filename, the
intention now is to use copy and paste when the Acrobat printer prompts for
a filename. I copy the range that includes the filename, and then start my
VBA routine. VBA opens up the Acrobat printer and prompts for a filename,
but the paste command is grayed out. I can paste it into a Word document,
but not into the filename box for the Acrobat printer.

Suggestions?
 
M

Michael Bednarek

I am using Excel 2003.

I am trying to output a print area from my spreadsheet to a PDF file, but I
can't seem to find a way to automatically or even semi-automatically specify
the filename. I generate the path and filename in Excel.

I tried the PrintToFile option of the Printout method, but it wound up
prompting me to disable a font feature in Acrobat. I got cold feet at that
point because of the sensitivity to changing settings in my work
environment. I'm not sure PrintToFile would get me PDF anyway.

Since I couldn't find a way to automatically enter the filename, the
intention now is to use copy and paste when the Acrobat printer prompts for
a filename. I copy the range that includes the filename, and then start my
VBA routine. VBA opens up the Acrobat printer and prompts for a filename,
but the paste command is grayed out. I can paste it into a Word document,
but not into the filename box for the Acrobat printer.

Suggestions?

I suggest you use the PDFDistiller object (from the "Acrobat Distiller"
library (ACRODIST.EXE)) and its FileToPDF method. Some details at the
links in
<http://groups.google.com.au/group/c...c507e4a1?lnk=st&rnum=2&hl=en#2ed583c3c507e4a1>.

Alternatively, the free PDFCreator also provides a COM/OLE interface and
its distribution provides examples in VBA. It's what I use now.
 
G

Gary Burton

Thanks for your response!

It isn't a practical solution in my case because I am on a highly
controlled network and can't change either the software or the setting.

I found a way to print to a textbox, then copy from the textbox before I
launch the output routine. then I can patch the filename in.
 

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