Thank you very much - looks like it will do the trick. Cheers
"Graham Mayor" wrote:
Try the following
'Unprotect the file
If ActiveDocument.ProtectionType wdNoProtection Then
bProtected = True
ActiveDocument.Unprotect
End If
Put your code here
'Reprotect the document.
If bProtected = True Then
ActiveDocument.Protect _
Type:=wdAllowOnlyFormFields, NoReset:=True
End If
--
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
Keenly52 wrote:
I'm creating a user form in Word that includes a table to be sorted
afterthe user enters their info - specifically a sort on the "date"
column.
The macro I created works fine in an unprotected doc, but not when
it's protected - which it will always be when being used by others.
I can't find a Word command to include in the macro unprotect the doc
or the selection ('ProtectedForForms = False' doesn't work in Word)
... I can't create a macro in a protected document (I don't think),
and when clicking on "Protect Document" the macro stops recording.
Any help with a solution is greatly appreciated. Thanks.