S
Starbird
I have a template with several sections and several different procedures. In
one procedure I need to unprotect 2 sections leaving the others protected. I
have found the following code:
Sub ToolsProtectUnprotectDocument()
Dim oDoc As Document
Set oDoc = ActiveDocument
On Error GoTo ErrMess
If oDoc.ProtectionType = wdNoProtection Then
With Dialogs(wdDialogToolsProtectDocument)
.noreset = True
.Show
End With
Else
oDoc.Unprotect
End If
Exit Sub
ErrMess:
MsgBox Err.Description, vbInformation
End Sub
Sub ProtectForm()
If ActiveDocument.ProtectionType = wdAllowOnlyFormFields Then
ActiveDocument.Unprotect
Else
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, noreset:=True
End If
End Sub
That works great, except it brings up the "Protect Document" dialog box. I
don't want the users to have any options, I simply want the 2 sections to
unprotect long enough to update the information without dumping the data in
all the form fields in other sections.
Any assistance would be greatly appreciated!!!
SRD
one procedure I need to unprotect 2 sections leaving the others protected. I
have found the following code:
Sub ToolsProtectUnprotectDocument()
Dim oDoc As Document
Set oDoc = ActiveDocument
On Error GoTo ErrMess
If oDoc.ProtectionType = wdNoProtection Then
With Dialogs(wdDialogToolsProtectDocument)
.noreset = True
.Show
End With
Else
oDoc.Unprotect
End If
Exit Sub
ErrMess:
MsgBox Err.Description, vbInformation
End Sub
Sub ProtectForm()
If ActiveDocument.ProtectionType = wdAllowOnlyFormFields Then
ActiveDocument.Unprotect
Else
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, noreset:=True
End If
End Sub
That works great, except it brings up the "Protect Document" dialog box. I
don't want the users to have any options, I simply want the 2 sections to
unprotect long enough to update the information without dumping the data in
all the form fields in other sections.
Any assistance would be greatly appreciated!!!
SRD