Results 1 to 2 of 2
Thread: Password setting from code
2001-02-07, 14:06 #1pilotGuest
Password setting from code
I've got the following problem: The setting of a password to protect a module within ms word 97 is done manually by selecting the properties of the vb project in the vb editor and then typing in a password on the apropiate tab.
I want to do the same but in VBA code. I need to know how to set and most of all remove the passwordprotection from the VBA project.
Please do not be confused: I know how to set and disable the protection of the actual document. I just need the same for the VBA project.
Hope anyone can help me.
2001-02-07, 19:30 #2
- Join Date
- Dec 2000
- New York, NY
- Thanked 29 Times in 27 Posts
Re: Password setting from code
Unfortunately it looks like this can't be set via code.
The VB help says that the Protection property for a VBProject:
<pre>Returns a value indicating the state of protection of a project. Read-only.
The Protection property return values are:
vbext_pp_locked The specified project is locked.
vbext_pp_none The specified project isn't protected.
And gives the following example:
Protection Property Example
The following example uses the Protection property to return a value indicating whether or not a project is protected. The value returned is a number that corresponds to a predefined constant representing the project's status.