Convert MSProject to PDF

V

vs.parthasarathy

Hi

I am trying to convert MSProject file to PDF. Please see the code
below.

Dim proj As MSProject.Application
Set proj = Interaction.GetObject(Class:="MSProject.Application")
proj.FilePrintSetup "Adobe PDF"
proj.FilePrint ShowIEPrintDialog:=False

When FilePrint is executed, it pops up a File save As dialog to
specify the PDF File name.
Is there any way specify the PDF filename programmatically and avoid
this File Save As dialog?

Thanks,
VSP
 
R

Rod Gill

It depends what pdf printer driver you are using. You need one that can be
configured to automatically create the file with the same name (but .pdf
extension in the same folder as the original file.

--

Rod Gill
Microsoft MVP for Project

Author of the only book on Project VBA, see:
http://www.projectvbabook.com
 
V

vs.parthasarathy

Hi,

In Excel/Word/Powerpoint object model, there are options to specify
"PrintTofile" and "TargetFileName" in ActiveDocument.PrintOut method.
I am expecting something similar to this in MSProject.

For example, if my project filename is myproject.mpp I want to
generate myproject.pdf in the same directory.

Thanks,
VSP
 
M

Mike Glen

Hi VSP,

Try posting on the developer newsgroup as this one is closing down.
Please see FAQ Item: 24. Project Newsgroups. FAQs, companion products
and other useful Project information can be seen at this web
address:http://project.mvps.org/faqs.htm .

Mike Glen
Project MVP




-----Original Message-----
From: (e-mail address removed)
[mailto:[email protected]]
Posted At: 10 March 2009 07:06
Posted To: microsoft.public.project.vba
Conversation: Convert MSProject to PDF
Subject: Convert MSProject to PDF

Hi

I am trying to convert MSProject file to PDF. Please see the code
below.

Dim proj As MSProject.Application
Set proj = Interaction.GetObject(Class:="MSProject.Application")
proj.FilePrintSetup "Adobe PDF"
proj.FilePrint ShowIEPrintDialog:=False

When FilePrint is executed, it pops up a File save As dialog to
specify the PDF File name.
Is there any way specify the PDF filename programmatically and avoid
this File Save As dialog?

Thanks,
VSP
 

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