E
Eric
I found this code posting and am having problems when using it. I want to
protect all evvan numbered sections and not the odd numbered sections. I am
getting a Compile Error: (Else without If) Error. Any help would be
appreciated, here is the code:
Sub reprotect()
Dim sPassword As String
For Each oSection In ActiveDocument.Sections
'If the section's index / 2 <> 0 (odd) protection needed'
If oSection.Index Mod 2 <> 0 Then oSection.ProtectedForForms = True
Else
'no protection needed(even)'
oSection.ProtectedForForms = False
End If
Next
If lProtected <> wdNoProtection Then
sPassword = "Review"
ActiveDocument.Protect Type:=lProtected, noreset:=True, Password:="Review"
End If
End Sub
Thanks
protect all evvan numbered sections and not the odd numbered sections. I am
getting a Compile Error: (Else without If) Error. Any help would be
appreciated, here is the code:
Sub reprotect()
Dim sPassword As String
For Each oSection In ActiveDocument.Sections
'If the section's index / 2 <> 0 (odd) protection needed'
If oSection.Index Mod 2 <> 0 Then oSection.ProtectedForForms = True
Else
'no protection needed(even)'
oSection.ProtectedForForms = False
End If
Next
If lProtected <> wdNoProtection Then
sPassword = "Review"
ActiveDocument.Protect Type:=lProtected, noreset:=True, Password:="Review"
End If
End Sub
Thanks