Prevent user interection in unattended code process

O

ODI

I try to scan documents to find out corrupt ones from earlier versions. My
code runs unattended. But i get the Password-Dialog to open the protected
files (not content protection but file protection), this stops my code and
waits user
interaction. In such a case i don't even need to open the document, instesd
would close it and log it as protected. With which API can I get the handle
of the PW-Dialog and send it the command to cancel it? Or is there any other
method to get rid of this Dialog-Window?

My code runs under Word 2003 - VBA
I used Application.DisplayAlerts = wdAlertsNone which should prevent this
PW-Dialog from appearing but it doesn't work!!! It must be a bug or the
PW-Dialog doesn't count as an alert...

HasPassword-Property works after opening the document, which doesn't help
either, because i can't open it without entering the password.

I'll be happy about any helping idea..
Thanks
 
J

Jonathan West

ODI said:
I try to scan documents to find out corrupt ones from earlier versions. My
code runs unattended. But i get the Password-Dialog to open the protected
files (not content protection but file protection), this stops my code and
waits user
interaction. In such a case i don't even need to open the document,
instesd
would close it and log it as protected. With which API can I get the
handle
of the PW-Dialog and send it the command to cancel it? Or is there any
other
method to get rid of this Dialog-Window?

My code runs under Word 2003 - VBA
I used Application.DisplayAlerts = wdAlertsNone which should prevent this
PW-Dialog from appearing but it doesn't work!!! It must be a bug or the
PW-Dialog doesn't count as an alert...

HasPassword-Property works after opening the document, which doesn't help
either, because i can't open it without entering the password.

I'll be happy about any helping idea..
Thanks

Skipping Password-Protected Documents in a Batch Process
http://www.word.mvps.org/FAQs/MacrosVBA/CheckIfPWProtectB4Open.htm
 

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