Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete logos from headers in word

Status
Not open for further replies.

mudstuffin

Technical User
Sep 7, 2001
92
GB
Can anyone help with this...?

I want to run a sub to delete all the headers and footers in a word document. Each header has a logo and text in it, and each footer has text.

Thanks in anticipation.



mudstuffin
 
This macro is written by Astrid, a Word MVP

Sub strippit()
Dim oSection As Section, oHeaderFooter As HeaderFooter
For Each oSection In ActiveDocument.Sections 'weg met headers en footers
For Each oHeaderFooter In oSection.Headers
oHeaderFooter.Range.Delete
Next
For Each oHeaderFooter In oSection.Footers
oHeaderFooter.Range.Delete
Next
Next
End Sub


 
Thanks for that xlhelp.

It does the job nicely.

Incidentally, do you know how I can modify it to run the process through all the open documents as opposed to the active doc.

Thanks again.



mudstuffin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top