Hi Jezebel
That is the type of code I am using, but I need to be able to change the
strPassword value through code depending on whether the ActiveDocument is
protected for Forms with a password or without a password. The ActiveDocument
is protected for Forms, I just need to identify if it has a "real" password
or if it is protected but without a password and change the value of the
strPassword variable to reflect this condition before I try to unprotect it.
I don't want any user interaction here, just the code doing what it is
supposed to do.
Is there a way of doing this?
> The method suggested in the Help file looks reasonable --
>
[quoted text clipped - 18 lines]
> >
> > I would really appreciate any help.
Jezebel - 03 Feb 2005 07:40 GMT
Try it and trap the error.
> Hi Jezebel
>
[quoted text clipped - 39 lines]
>> >
>> > I would really appreciate any help.
koolnuts - 03 Feb 2005 08:05 GMT
I am trapping for Err.Number = 5485 ("The password is not correct" error) but
before it goes to the error handler and runs the code specific to this error
it brings up the "Unprotect Document" password dialog box which the use then
needs to click on before the program will then continue - which I don't want.
So I need to either:
1: find out how to identify if the document is protected with a password and
use the correct password when trying to unprotect the document; or
2: bypass the "Unprotect Document" password dialog box and then set the
password variable value in the Error_Handler and Resume execution.
Any ideas?
> Try it and trap the error.
>
[quoted text clipped - 41 lines]
> >> >
> >> > I would really appreciate any help.