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.

Re: How to print document automatically by Doug

Doug
Mon Jul 07 01:22:13 CDT 2003

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
"Wei Xie" <xiewei@ths.com.cn> wrote in message
news:04e001c34443$b13e3ed0$a101280a@phx.gbl...
> 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.



Re: How to print document automatically by Doug

Doug
Mon Jul 07 06:30:43 CDT 2003

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
"Wei Xie" <xiewei@ths.com.cn> wrote in message
news:72ac01c34466$b9cfeb70$a401280a@phx.gbl...
> Hi, Doug
>
> It works, thank you very much. I never know there are so
> much tips in word programming. Sign!
>
> But there remains another question till now. For some
> documents, the message "xxx margin is out of the
> printable region, continue?" will be alerted. Because I
> use Chinese word, I can't give you exact English message.
>
> The popup dialog also hinder the print process. Do you
> have any idea?
>
> Wei
>
>
> >-----Original Message-----
> >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/CheckIfPWProtectB
> 4Open.htm
> >
> >Please respond to the newsgroups for the benefit of
> others who may be
> >interested.
> >
> >Hope this helps
> >Doug Robbins - Word MVP
> >"Wei Xie" <xiewei@ths.com.cn> wrote in message
> >news:04e001c34443$b13e3ed0$a101280a@phx.gbl...
> >> 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.
> >
> >
> >.
> >



Re: How to print document automatically by Wei

Wei
Wed Jul 09 03:23:40 CDT 2003

Thank you, Doug. It really works.