View Single Post
  #12   Report Post  
Posted to microsoft.public.word.pagelayout
Lene Fredborg Lene Fredborg is offline
external usenet poster
 
Posts: 1,291
Default Removing Header and Footer Sections

I think the only difference between Word 2007 and what was previously seen in
earlier versions here is that the paragraph mark is now made invisible if
there is no other content in the header (the same applies to the footer). If
you run the following little macro, you will find that the apparently empty
header always contains a paragraph mark:

Sub TestHeader()
With ActiveDocument.Sections(1).Headers(wdHeaderFooterP rimary).Range
If .Text = Chr(13) Then
MsgBox "Header consists of a paragraph mark"
ElseIf .Text = "" Then
MsgBox "Header is empty"
End If
End With
End Sub

--
Regards
Lene Fredborg - Microsoft MVP (Word)
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word


"Suzanne S. Barnhill" wrote:

I think this must have been fixed (at least for Word 2003) because I can now
delete header/footer content in a Word 2003 document and see no empty
paragraph in the header/footer.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

"PamC" wrote in message
...
I recall from reading discussions here and elsewhere--discussions
explaining why it's not a good idea to put headers and footers in the
normal
template--that once a header or footer has been added to a document you
cannot get rid* of the ending paragraphs marks.

So, in a document that has never had header or footer content added,
displaying formatting marks while the cursor is in the main story shows no
paragraph mark in the header or footer. But doing the same thing in a
document that at one time had header or footer content will show a
paragraph
mark in the now nearly empty header or footer.

I suspect that the difference is between the capability of a header/footer
and the user created reality of it.

*But not too long ago, a Word MVP, offered a VBA way of getting rid of
it.
Sorry I can't recall where I saw it.

PamC


"Suzanne S. Barnhill" wrote:

I'm not surprised. I just wonder what Word is registering as a change.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA