Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2004

Tip: Looking for answers? Try searching our database.

Using two passwords in a macro

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ken White - 31 Oct 2004 15:09 GMT
I installed a tremendously benificial macro that allows me to use SpellCheck
in locked forms.  We have hundreds of these locked forms. and some of them
have different passwords to lock them.  Is it possible to have the macro
recognize at least two passwords?
Klaus Linke - 03 Nov 2004 09:11 GMT
> I installed a tremendously benificial macro that allows me
> to use SpellCheck in locked forms.  We have hundreds of
> these locked forms. and some of them have different passwords
> to lock them.  Is it possible to have the macro recognize at least
> two passwords?

Hi Ken,

Try them both?

' Ignore error if 1st password is wrong:
On Error Resume Next
If ActiveDocument.ProtectionType <> wdNoProtection Then
 ActiveDocument.Unprotect Password:="Test1"
End If
' So you get an error message
' if the 2nd password still isn't the right one:
On Error GoTo 0
If ActiveDocument.ProtectionType <> wdNoProtection Then
 ActiveDocument.Unprotect Password:="Test2"
End If

Regards,
Klaus
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.