Results 1 to 2 of 2
  1. #1
    Star Lounger
    Join Date
    Apr 2003
    Kansas City, Missouri
    Thanked 0 Times in 0 Posts

    Cannot override Unprotect Document command (Word 2003 SP 3)

    I am trying to incorporate code that warns a user against unprotecting a document. I'm having trouble overriding the Unprotect command though. When I try it out, I unprotect the document with no message box.

    Am I doing the command wrong? Here is what I have:

    <pre>Sub ToolsProtectUnprotectDocument()

    If MsgBox("Please note that the automated features of this form rely on the document's " & _
    "form elements " & _
    "remaining unchanged. Unprotecting the form could lead to file corruption and an error "& _
    "in running" & _
    "the automated features." & vbCr & vbCr & "Are you sure you wish to unprotect the form?", _
    vbYesNo, _
    "Unprotect Detected") = vbYes Then


    End If

    End Sub</pre>

    I appreciate any assistance you can offer.


  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 Posts

    Re: Cannot override Unprotect Document command (Word 2003 SP 3)

    Your macro works for me in Word 2002, but it only traps the Tools | Unprotect Document menu command, not the Protect / Unprotect button on the Forms toolbar, and I assume it won't work with the Protect Document task bar (or whatever it's named) in Word 2003.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts