How do I automate printing project file to pdf

S

SiOptix

Hi,

I am trying to create a pdf file from a project file opened in Microsoft
Project. I have the project file open and can invoke the printer dialog box
with "app.FilePrint" command but I need to automate the rest of the process
of creating the pdf file. I already have the pdf creater chosen as the
printer in the print dialog box through "app.FilePrintSetup ("PDF995")" but
need to automate the dialog box without any input from the user.

I tried to use SendKeys to click the "OK" button in the printer dialog box
but it didn't work. Does anybody have any suggestion on how I can automate
the printing without any user input???

Thanks in advance
Emil S.
 
W

William Raymond

Hi Emil,

You can use the FilePrint command, but need to make use of a sort of vague
feature called "ShowIEPrintDialog". You can do the printing function this
way:

x = FilePrint(, , , , , , , , , , False)

-Bill
 
S

SiOptix

That solves part of my problem Bill, the other being the file name
specification. Your solution brings the saveas dialog box that expects a
name for the pdf file. Is there any way of automating this dialog box to
specify a filename and folder??? I am using pdf995 as the pdf creator and
their help on this issue is a bit troublesome to follow. Any help that you
can give me on this issue is greatly appreciated.

William Raymond said:
Hi Emil,

You can use the FilePrint command, but need to make use of a sort of vague
feature called "ShowIEPrintDialog". You can do the printing function this
way:

x = FilePrint(, , , , , , , , , , False)

-Bill

--
William Raymond [MS Project MVP]
(e-mail address removed)
BLOG: http://www.mympa.org/blog.aspx


SiOptix said:
Hi,

I am trying to create a pdf file from a project file opened in Microsoft
Project. I have the project file open and can invoke the printer dialog
box
with "app.FilePrint" command but I need to automate the rest of the
process
of creating the pdf file. I already have the pdf creater chosen as the
printer in the print dialog box through "app.FilePrintSetup ("PDF995")"
but
need to automate the dialog box without any input from the user.

I tried to use SendKeys to click the "OK" button in the printer dialog box
but it didn't work. Does anybody have any suggestion on how I can automate
the printing without any user input???

Thanks in advance
Emil S.
 

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