View Single Post
  #3   Report Post  
Posted to microsoft.public.word.docmanagement
WordWorker WordWorker is offline
external usenet poster
 
Posts: 16
Default Macro to Unlock a Locked Word 2007 Document

Thank you so much, Greg. You are a job saver!


"Greg Maxey" wrote:

Sub OnExit()
If ActiveDocument.ProtectionType wdNoProtection Then
ActiveDocument.Unprotect
MsgBox "I'm unlocked. Do your deed."
ActiveDocument.Protect wdAllowOnlyFormFields, True
MsgBox "I'm back in chains."
Else
MsgBox "I wasn't locked to start with"
End If
End Sub



WordWorker wrote:
Is it possible -- and how do I do it -- to write a macro that a text
input field will run to temporarily unlock a locked Word 2007 form?
I wrote one that will lock the document that will run "On exit" from
a field, but no matter how I phrase it I can't get a macro to unlock
the doc.


--
Greg Maxey - Word MVP

My web site http://gregmaxey.mvps.org
Word MVP web site http://word.mvps.org