PDA

View Full Version : Macro to find and replace all headers



Chukesgirl
07-25-2008, 01:05 PM
I am converting some legal pleadings from WordPerfect to Word 2007. Since WordPerfect is no longer on my system, what I have been doing is opening the WordPerfect documents in Word and Saving them as Word documents. The lines and numbers on the left side of the document did not convert well. They came over as little tick marks in a header in different sections throughout the document, so I just want to remove them. I would like to write a macro that would find the header and delete it and then go to the next header and delete it and keep doing that until it removes them all. Doing it manually is very tedious, especially in long documents. Thanks for any assistance.

fumei
07-26-2008, 09:48 AM
Dim oHF As HeaderFooter
Dim oSection As Section
For Each oSection In ActiveDocument.Sections
For Each oHF In oSection.Headers
oHF.Range.Delete
Next
Next

will delete all headers, in all Sections.