Forum Discussion
Adding background color every second paragraph in an MS Word TOC
Hi,
I recently converted a PDF file originally designed in InDesign to an MS Word file. The TOC had a background color set for every second paragraph.
Since I found no automatic solution to this challenge, I had to draw a box that had a specific color and duplicate it as in the above image. Lucky me the document hasn't had too many chapters.
I know and I used on many occasions the option from the DESIGN tab - PAGE BORDERS - SHADING. But, it will update the entire TOC1 style or TOC2 style, depending on where I am trying to apply it.
I set TOC1 and TOC2 to never auto-update and I tried to apply SHADING to every second row. It worked. Ish. For TOC2 the shading started indented, which I did not want. I needed to be the same indent as TOC1.
Is there an option for doing that automatically?
Thank you,
Sebastian
4 Replies
- Charles_KenyonBronze Contributor
This will not be simple and should be done only after you have a final document.
Change your TOC, which is a field, into a Table, and apply a table style.
I cannot tell you how to do this off the top of my head but it would involve unlinking the field and converting the text to a table. It is not simple, in my opinion. If you want to do this, I will figure out the exact steps I would use.
- SEBA_ROCopper Contributor
I had thought of it. However, I had to set the TOC automatically in case the final client changes something on his/her end.
How about using Manual Paragraph Shading.
Since TOC entries are just regular paragraphs once generated, you can manually apply background color to every second paragraph:
- Select every second paragraph and use Paragraph → Shading in the “Design” tab.
- To speed it up, create a custom style (e.g., "AltTOCHighlight") based on TOC1 or TOC2, but with added shading. Then apply it manually to selected lines.
- SEBA_ROCopper Contributor
Since TOC02 is already a style, I am not sure MS Word can accept two different styles for level 2 headings. Unless I set a different style for all heading 2 levels that will need a shadow.