Change Header Text Only in Section

J

James Pannozzi

I'd like to change or do different headers in
specfic sections of a document without disturbing
the header text in the other sections.

The document is initially created with all headers the same
in all sections.

If I try this:

With ActiveDocument.Sections(3)
.Headers(wdHeaderFooterPrimary).Range.Text = "Mary had a little
lamb..."
End With

It changes the headers of all the sections instead of just changing
Sections(3)'s header.

Thanks
Jim
 
C

Chad DeMeyer

James,

ActiveDocument.Sections(3).Headers(wdHeaderFooterPrimary).LinkToPrevious =
False
ActiveDocument.Sections(4).Headers(wdHeaderFooterPrimary).LinkToPrevious =
False
ActiveDocument.Sections(3).Headers(wdHeaderFooterPrimary).Range.Text = "Mary
had a little lamb..."

Regards,
Chad
 
J

James Pannozzi

Thanks, but those 3 lines leaves all headers unchanged.

I wonder if that middle one should be LinkToNext or some such thing... I'll
check it out.

Thanks Again
Jim
 
J

James Pannozzi

Yes, that worked.

Thanks Again
Jim

Chad DeMeyer said:
James,

ActiveDocument.Sections(3).Headers(wdHeaderFooterPrimary).LinkToPrevious =
False
ActiveDocument.Sections(4).Headers(wdHeaderFooterPrimary).LinkToPrevious =
False
ActiveDocument.Sections(3).Headers(wdHeaderFooterPrimary).Range.Text = "Mary
had a little lamb..."

Regards,
Chad
 
J

James Pannozzi

Oh, I forgot to mention, that it was'nt working because you also have
to change one of the Page Setup properties:

.DifferentFirstPageHeaderFooter = True

J
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top