L
lstgfin
Greetings,
I am attempting to write a macro to clear all headers in a document, then
turn off line numbering for the whole document. The following macro clears
the headers ok, but gets an "out of range" error at the line numbering part.
I would greatly appreciate any assistance.
Dim oSec As Section
Dim oHead As HeaderFooter
For Each oSec In ActiveDocument.Sections
For Each oHead In oSec.Headers
If oHead.Exists Then oHead.Range.Delete
Next oHead
Next oSec
ActiveDocument.PageSetup.LineNumbering.Active = False
End Sub
I am attempting to write a macro to clear all headers in a document, then
turn off line numbering for the whole document. The following macro clears
the headers ok, but gets an "out of range" error at the line numbering part.
I would greatly appreciate any assistance.
Dim oSec As Section
Dim oHead As HeaderFooter
For Each oSec In ActiveDocument.Sections
For Each oHead In oSec.Headers
If oHead.Exists Then oHead.Range.Delete
Next oHead
Next oSec
ActiveDocument.PageSetup.LineNumbering.Active = False
End Sub