Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Please help..macro password

Status
Not open for further replies.

mgkSHA

Programmer
Jul 12, 2002
126
0
0
US
I am at my wits end over here...need some help.

I have a large Word module that I am re-writing. Now on certain documents the MACROS are protected. Now the ActiveDocument itself is not protected. The following code produces no results because it is not protected:

ActiveDocument.unprotect Password:=pwWord

What I need is a way to unprotect the macros via code. I know the password, but every attempt I make to pass a password fails. Such as:

ActiveDocument.VBProject.VBComponents.unprotect Password:=pwWord

ActiveDocument.VBProject.unprotect Password:=pwWord.

both of these throw compiler errors.

How can I simply pass the Macro's password...any ideas. I am stumped.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top