3

We have a Word document here which contains a number of hidden paragraphs, including headings. Depending on the respective view/print setting, these paragraphs are (or are not) shown/printed - all fine.

However, independent on these settings, the prespective headings never appear in the table of contents.

Is there a way around this? I'd like to appear the headings in the TOC if and only if they're visible, per the view setting.

2
  • I don't think it's possible to include the heading in the TOC based on the current view settings. You can either exclude it fully or include it fully (using TC fields). One possible idea is that you can use a macro which detects when the document view is changed and unhides hidden text etc.
    – Adam
    Mar 13, 2014 at 22:13
  • Thought about macros as well, but am very reluctant about actually tapering with the (non-generated) document content: I'm pretty sure that at some point, the document would end up with these (temporary) changes being persisted by the users, and probably modified to an extent where the macro would work anymore. Mar 24, 2014 at 8:30

1 Answer 1

2

I'm not sure if anyone is still looking for a way to do this, but I too wanted to do it and I've got a work around. In word 2016, btw.

In my case I wanted a heading followed by a blank line, but with information in that line that would appear in a TOC. I didn't want to use white text, because the finalized document is issued as a pdf and the text could be made readable, plus anyone who wants to edit or read the text while they're working is at a loss.

I started with the heading I want to appear along with the bond on Level 7. The text on the next line - which I want hidden - is a heading on level 8. Follow that with a third line, containing only a blank space, which is a heading on a higher (lower, numerically) level that I'm not using for anything else - in this case I used 6. Then change the para mark between the level 8 and level 6 headings to style separator (Ctrl-Alt-Enter), so both level 8 and 6 are on the same line. Follow that with body text.

Then if I collapse the level 7 heading, the level 8 heading disappears. The level 6 heading stops the collapse at the end of that line, so it appears as a blank line between the level 7 heading and body. Then set the TOC to show levels 7 and 8 but don't show level 6.

1
  • 1
    This is beautiful and horrible.
    – raithyn
    Jul 11, 2020 at 2:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .