Consulting

Results 1 to 3 of 3

Thread: Code for specific format for Table of contents

  1. #1

    Code for specific format for Table of contents

    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.

  2. #2
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    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.
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •