Silent Printing (Word/Excel) via Automation?

J

Joseph Geretz

We use Word and Excel via automation to display and print documents from
within our application. Our application is compatible with Office 2000, XP
and 2003. Is there any way to print from Word and/or Excel without
generating the 'Printing...' dialog?

Thanks!

- Joe Geretz -
 
C

Cindy M.

Hi Joseph,
We use Word and Excel via automation to display and print documents from
within our application. Our application is compatible with Office 2000, XP
and 2003. Is there any way to print from Word and/or Excel without
generating the 'Printing...' dialog?
As far as Word is concerned, you could set the BackgroundPrinting option to
True. The problem with that is that your code will then continue to run,
without waiting for the printing job to finish. And I'm guessing the next
thing your code does is to close the document being printed. Catch-22.

No, there's no way to suppress that dialog box, otherwise. Word was designed
for user interaction, and it's there to keep the user from trying to work
with Word while a print job is running, as long as the option is off...

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 :)
 
J

Joseph Geretz

Hi Cindy,
As far as Word is concerned, you could set the BackgroundPrinting option
to
True. The problem with that is that your code will then continue to run,
without waiting for the printing job to finish. And I'm guessing the next
thing your code does is to close the document being printed. Catch-22.

Yes, this is *exactly* the problem we would face if we allowed Word to
asynchronously perform the printing in the background. In fact, we force the
issue by explicitly setting Word not to perform background printing when we
spin up the Application object.
No, there's no way to suppress that dialog box, otherwise. Word was
designed
for user interaction

Yes, this seems to be the case, as far as I've seen so far. While both Word
and Excel can function as server applications, it has proven difficult to
suppress the interactive nature of these applications entirely.

Thanks for your advice.

- Joe Geretz -
 
M

Michael Emmons

Joseph,

You might want to try to set BackgroundPrinting to true and then add code to
check the property BackgroundPrintingStatus and don't continue if it returns

-mike
 

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