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 2006

Tip: Looking for answers? Try searching our database.

On Error Function not Working

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Amit - 04 Nov 2006 13:23 GMT
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!!!
 
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.