PDA

View Full Version : Code for specific format for Table of contents



Knightfall
02-13-2018, 05:07 PM
Is there code that can be used to command the table of contents to be a specific font and size? Right now, I have a TOC being created, and 2 of the line items are a different font from the rest of the toc. Additionally, the toc is being created in Calibri font, and I would like to create it using Arial.

macropod
02-13-2018, 06:42 PM
Table of Contents formatting is managed by TOC Styles, TOC Styles are ordinarily linked to Heading Styles. To change the Table of Contents formatting, change the relevant TOC Styles; trying to override the formatting in a Table of Contentsis a waste of time, since the Table of Contents formatting will revert to whatever the TOC Styles specify immediately the Table of Contents is refreshed.


As for "2 of the line items are a different font from the rest of the toc", that suggests you've used a different Heading Style for those entries. The solution is to either:
a) apply the same Heading Style to those two items as for the other headings; or
b) modify the corresponding TOC Style to match whichever other TOC Style you want it to look like.


None of this requires VBA.

Knightfall
02-15-2018, 04:50 PM
Once again Macropod, you have helped me tremendously and saved me a TON of time. Thank you very much.

I was able to solve my issue by properly editing the TOC styles as you suggested and editing the data exported from my program into Word.