View Single Post
 
Old 12-28-2010, 11:59 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2000
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi Dan,

Try the following macro - it should get the 'locked' document out of design mode:
Code:
Sub UnlockFile()
If ActiveDocument.FormsDesign = True Then
  ActiveDocument.ToggleFormsDesign
End If
End Sub
Note: If this is the only macro in the document, you'll want to delete the code module before saving the document, otherwise you'll get a macro-enable prompt next time you open it.

If that works, but you still have the document going into design mode when you re-open it, try using the following to force it out of design mode every time it's opened:
Code:
Private Sub AutoOpen()
' Runs when this document is opened.
If ActiveDocument.FormsDesign = True Then
  ActiveDocument.ToggleFormsDesign
End If
End Sub
Unfortunately, this also means you'll get the macro-enable prompt whenever you open the document.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]

Last edited by macropod; 12-29-2010 at 01:45 PM.
Reply With Quote