Saving word doc to pdf without prompt

S

scw-tzg

In the course of automated Mail merge from Word 2003 (using C++), I would
like to save generated doc as pdf. After reviewing my voluminous options,
I'd prefer to install some low-cost PDF print driver and direct Word to print
to this. Is there some way to prevent the print driver's Save As dialog from
displaying when I call Word DOM PrintOut or WordBasic FilePrint? (I don't
need the user to specify a pdf file name; I will provide a unique one via
code.) It seems like for some such PDF print drivers, they allow for some
type of programmatic overrides, such as setting a value in the registry to
name the resulting pdf file. Optimally, I would like to tell my users to
select *any* PDF print driver. Is there a some generic Windows way to force
an output pdf file name and prevent the save as dialog?

Thanks for any ideas.
 
C

Cindy M.

Hi =?Utf-8?B?c2N3LXR6Zw==?=,
In the course of automated Mail merge from Word 2003 (using C++), I would
like to save generated doc as pdf. After reviewing my voluminous options,
I'd prefer to install some low-cost PDF print driver and direct Word to print
to this. Is there some way to prevent the print driver's Save As dialog from
displaying when I call Word DOM PrintOut or WordBasic FilePrint? (I don't
need the user to specify a pdf file name; I will provide a unique one via
code.) It seems like for some such PDF print drivers, they allow for some
type of programmatic overrides, such as setting a value in the registry to
name the resulting pdf file. Optimally, I would like to tell my users to
select *any* PDF print driver. Is there a some generic Windows way to force
an output pdf file name and prevent the save as dialog?
Only Office 2007 has an option to "save as" to PDF (and MSFT had to provide that
as an optional add-in).

As far as I know, you'd need to use the PrintOut method, and take care to supply
the file name, etc. using that method's arguments (PrintToFile, OutputFileName).
That should suppress any dialog box that wants to prompt for missing
information.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 
S

scw-tzg

Cindy,

It seems when I use PrintToFile & OutputFileName parms with the PrintOut
method (when my PDF print driver is active printer), the file is saved in
*Postscript* format, the way it would if any other (real) printer were
currently selected. It does name it xxx.pdf like I requested, but it is not
PDF format; Acrobat Reader cannot open it.

So frustrating!
Thanks, as always, for your input.
Susan
 

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