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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

word header problem

Status
Not open for further replies.

ambercr

Technical User
Aug 10, 2009
2
US
I have a header box that mysteriously popped in and it is huge. I can not delete it. It simply does nothing. In this large document the previous headers are small and even trying to make it "Same as Previous does not work". I have to get this document out today for a board meeting and can not get rid of this header. All of the header boxes are empty. I am only using Footers. Any suggestions? Help I am running out of time!
 
What about copying everything to a new Word Doc, except for the problematic header? So in other words, create a blank doc, then copy all the content, paste to new Word Doc, then copy the footer, and paste it to the new doc...

That's not a very technical method, but perhaps it'll get the job done in your short of time need. [bigglasses]

--

"If to err is human, then I must be some kind of human!" -Me
 
I thought of that. The document is like 56 pages and it doesn't carry over the formatting exact. So I have a lot of little things to read back over and fix rather than just the one problem. Thank you for your input!
 
Ooo, this looks like what I figured must be possible. Try running this in a VBA module:
Code:
Sub DeleteHeader_Footer_Text()

     Dim hdr As HeaderFooter
    
     For Each hdr In ActiveDocument.Sections(1).Headers
        hdr.Range.Text = vbNullString
     Next hdr

     [GREEN]'For Each hdr In ActiveDocument.Sections(1).Footers
        'hdr.Range.Text = vbNullString
     'Next hdr[/GREEN]
End Sub

Just copy/paste the code into a new Module in the VBA editor window, and then hit the "Play" button - green triangle, or else press <F5> on your keyboard while cursor is inside the procedure, and that will run it. Since you only have on header in there, it'll take that out. Since you don't want to delete your footers, be sure to leave that there.

See if it works.

If so, here's where found it originally:

--

"If to err is human, then I must be some kind of human!" -Me
 
oh, almost forgot. Create a backup of your current copy JUST IN CASE. [wink]

--

"If to err is human, then I must be some kind of human!" -Me
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top