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

Removing Headers on TOC page (exists property)

Status
Not open for further replies.

sylve

Programmer
Jan 18, 2005
58
CA
I have a partial ToC for a subdocument seperated by section breaks. Upon insertion of the TOC, i would like to specify that no headers show up on these pages.

I'm using macros for the insertion and am trying to use the .exists property to remove any headers. Here is a sample:

sec.Headers(wdHeaderFooterEvenPages).Exists = False

The help file says it's a read/write property but it wont write. Doesn't generate a error either.

This is a hard-to-explain problem, sorry, but if you have any ideas or have used the exists property, i'd appreciate it.
 
Please describe EXACTLY what you are doing.

1. Are you bringing in the sub doc as a file?
2. Are you making a section break before you do so?
3. Does the sub doc have Different Odd/Even pages set up?

The Exists property does in fact take a Write. However, it is not quite straight forward. You can set it to False, and the header becomes wdHeaderFooterPrimary. BUT, the value of wdHeaderFooterEvenPages persists. Setting Exists to False does NOT delete the value. If you set it to True again, any text that was previously there will reappear. The values are stored in the section break. Exists (if this case) while it can be set to True or False, essentially sets the Options - Different Odd/Even. The original values persist.

So if you bring in text, and the previous section IS set to Different Odd/Even, and the new text does NOT have a section break, it will pick up by default the setting from the previous section. This automatically toggles Exists back to True.

Again, please describe exactly your process. It can be fixed. or have you got this one working????

Gerry
 
I delimited the section where the TOC would be before and said not to put a header on sections with no text.

When i inserted the TOC, no headers... Kind of a funny way to go about things but i got my results.

Gerry, thank you for your time.
 
That is definitely one way to do it.

Gerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top