A
andreas
Dear Experts: Below macro deletes the "DocProperty Author Field" from
all footers in my document. It runs FINE although I did NOT finish the
If-Statement with "End If", since I am getting an error message when
doing so (Error Message"End If without If Block"). How come?
Dim sect As Section
Dim HF As HeaderFooter
Dim f As Field
Dim rng As range
For Each sect In ActiveDocument.Sections
For Each HF In sect.Footers
Set rng = HF.range
For Each f In rng.Fields
If f.Type = wdFieldDocProperty And InStr(UCase(f.Code),
"AUTHOR") Then f.Delete
Next f
Next HF
Next sect
End Sub
all footers in my document. It runs FINE although I did NOT finish the
If-Statement with "End If", since I am getting an error message when
doing so (Error Message"End If without If Block"). How come?
Dim sect As Section
Dim HF As HeaderFooter
Dim f As Field
Dim rng As range
For Each sect In ActiveDocument.Sections
For Each HF In sect.Footers
Set rng = HF.range
For Each f In rng.Fields
If f.Type = wdFieldDocProperty And InStr(UCase(f.Code),
"AUTHOR") Then f.Delete
Next f
Next HF
Next sect
End Sub