protect and unprotect a documet with different passwords

F

Fred Kruger

can anyone tell me how to unprotect and reportect
documents with different passwords.
I know the usual protect and unprotect but what i want is
for the code to check if possible which password was used
to unlock the form and then re use it to reprotect it.

I produce forms for my company which are protected for
formfields and uses a password to allow the formfields to
be spell checked i also use the spellcheck from the
MVPwebsite. But my company also buys templates in for use
with a national based system and these documents have
different passwords.

So when the spell check is run a runtime error occurs or
the user has to put in the passords each time which is
not ideal.

So can anyone tell me how to check to see what password
is used to unlock the form and use thesame to reprotect
it.

Cheers

Fred
 
C

Cindy Meister -WordMVP-

Hi Fred,
I know the usual protect and unprotect but what i want is
for the code to check if possible which password was used
to unlock the form and then re use it to reprotect it.
No chance. What good would password protection be if it were
that easy to extract the password :)?

How critical IS the password security for these documents?
How "publicly" could you store the information so that your
macro could get at it?

AND, do the various sets of documents have some property in
common so that a common macro can recognize which kind it
is? (Like checking the attached template, or some document
Property?)

Otherwise, you'd basically need to have your macro check
each password and use error handling (or turn off error
handling completely) to have it continue until the correct
one is found.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jan
24 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:)
 
C

Cindy Meister -WordMVP-

Hi Fred,
I can only get the error mesage to occur when the user
has cancelled the password box or entered an incorrect
password.

Is there a way of forcing this error without the password
box appearing if so I can build the work round using the
error generated..?
Why should the password box be appearing? What does the user
have to do with any of this? What happens if you put an
incorrect password into your code (that is the topic...)?
What error number do you get?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jan
24 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:)
 

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