How to print document automatically

W

Wei Xie

I want to print all documents in one directory. I prefer
VB to launch word application, and open each document.
Then I use document.printout.

My question is the process will suspend if a doc has
marcos or password in it, because nobody will response
the popup dialog.

Anyone can suggest me how to answer the possible dialog
and continue the print process? Thanks in advance.
 
D

Doug Robbins - Word MVP

Hi Wei Xie,

See the article "How to skip password protected files, and avoid being
prompted for a password, when opening a batch of Word documents using VBA

Skipping Password-Protected Documents in a Batch Process" at:

http://www.mvps.org/word/FAQs/MacrosVBA/CheckIfPWProtectB4Open.htm

Please respond to the newsgroups for the benefit of others who may be
interested.

Hope this helps
Doug Robbins - Word MVP
 
D

Doug Robbins - Word MVP

Hi wei Xie,

You could try using

Application.DisplayAlerts = wdAlertsNone

but I am not sure if it will be effective in this case.

You shoud make sure that you turn it back on with

Application.DisplayAlerts = wdAlertsAll

at the end of the process.

Please respond to the newsgroups for the benefit of others who may be
interested.

Hope this helps
Doug Robbins - Word MVP
 

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