A
Amit
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!!!
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!!!