I tried to run the following code but it is not working:
Sub Amit()
Set myDoc = ActiveDocument
On Error GoTo ErrHandler:
If myDoc.ProtectionType = wdAllowOnlyComments Then
myDoc.Unprotect Password:="abcd"
myDoc.Password = "abc d"
myDoc.Protect Type:=wdAllowOnlyComments, Password:="abc d"
Exit Sub
Else: myDoc.Protect Type:=wdAllowOnlyComments, Password:="abcd"
Exit Sub
End If
ErrHandler:
MsgBox "An error occurred: " & CStr(Err.Number) & vbCrLf & _
"Description: " & Err.Description
End Sub
Please Smbody HELP!!!
Tony Jollans - 04 Nov 2006 14:30 GMT
It works for me. Could you be a bit more specific about what the error is.
--
Enjoy,
Tony
>I tried to run the following code but it is not working:
>
[quoted text clipped - 19 lines]
>
> Please Smbody HELP!!!