Macro to discontinue previous header/footer

K

Katrina

H

I'm trying to write a macro that goes to the end of a document, adds a section break and discontinues the header and footer from the previous section continuing in the new section, but the macro is removing the previous sections header and adding it to the new section instead. Any ideas on how I can get this right

Thank

Katrina
 
W

Word Heretic

G'day "Katrina" <[email protected]>,

manipulate the head/foot of .sections(sections.count) section


Steve Hudson
Word Heretic Sydney Australia
Tricky stuff with Word or words

Email: WordHeretic at tpg.com.au


Katrina was spinning this yarn:
 
M

Mark Tangard

Katrina,

Try this:

With Selection
.EndKey wdStory
.InsertBreak wdSectionBreakNextPage
With .Sections(1).Headers(wdHeaderFooterPrimary)
.LinkToPrevious = False
.Range.Delete
End With
With .Sections(1).Footers(wdHeaderFooterPrimary)
.LinkToPrevious = False
.Range.Delete
End With
End With


One tip: When you've tried to code something and failed, post your code when
asking for help. That's more helpful for you and usually makes for a quicker
diagnosis from us. It can also help us spot other problems you might run into
later.
 

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