Thread: [Solved] Delete a Line in a TOC
View Single Post
 
Old 11-25-2024, 01:29 PM
macropod's Avatar
macropod macropod is offline Windows 10 Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,466
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Assuming each Section has only one Level 1 Heading, then to do something like that for your various Section TOCs, you could use a field code like:

{IF{TOC \o "2"}= "Error!*" "" {TOC}}

Doing this will render the TOC references unlinkable (i.e. you can't click on them and be taken to the headings). You will, of course, need to supplement both of the TOC fields in the field coding above with your existing TOC field switches for determining the bookmarked range the TOC applies to.

Note: The field brace pairs (i.e. '{ }') for the above example are all created in the document itself, via Ctrl-F9 (Cmd-F9 on a Mac or, if you’re using a laptop, you might need to use Ctrl-Fn-F9); you can't simply type them or copy & paste them from this message. Nor is it practical to add them via any of the standard Word dialogues. The spaces represented in the field constructions are all required.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote