Oops! I forgot to answer your questions. The password is stored in a
spellcheck macro. The spell check macro unprotects the form, using the
password. When spell check is completed, the macro protects the form,
again, with the password.
Lilbit was telling us:
Lilbit nous racontait que :
> Oops! I forgot to answer your questions. The password is stored in a
> spellcheck macro. The spell check macro unprotects the form, using
> the password. When spell check is completed, the macro protects the
> form, again, with the password.
Try using document variables instead. They are better because they can be
created or modified only through VBA.
e.g:
Dim GetPassword As String
ActiveDocument.Variables("myvar").Value = "MyPassword"
GetPassword = ActiveDocument.Variables("myvar").Value
Make sure the variables exists before retrieving it or you will get an
error. See the online help for more info on document variables.

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
Lilbit - 15 Jul 2005 19:50 GMT
Thanks!!
Jonathan West - 18 Jul 2005 10:49 GMT
> Thanks!!
In addition, since any document variable can be read by anybody who knows
how to write a short VBA macro, I would recommend that you try to obfuscate
the password in some fashion. It won't save you from anyone who has a
program to crack your VBA project password (you *have* applied a pssword to
your VBA code?), but will protect you against ordinary inquisitive users.

Signature
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org