Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback. TablesOfContents Collection Object Support and feedback The table of contents is built from paragraphs styled with the Heading 1, Heading 2, and Heading 3 styles or the custom styles myStyle and yourStyle. This example adds a table of contents at the beginning of the active document. True to use outline levels to create the table of contents. True if page numbers in a table of contents should be hidden when the document is being publishing to the web. 1 Answer Sorted by: 4 This will create a TOC using VBA: Set rangeWord ActiveDocument. True if entries in a table of contents should be formatted as hyperlinks when the document is being publishing to the web. Use the Add method of a HeadingStyles object to create new heading styles. The string name for additional styles used to compile the table of contents (styles other than the Heading 1 – Heading 9 styles). True to include page numbers in the table of contents. True if page numbers in the table of contents are aligned with the right margin. If this argument is omitted, TC fields aren't used. For example, "T" builds a table of contents from TC fields using the table identifier T. Corresponds to the \f switch for a Table of Contents (TOC) field. The default value is False.Ī one-letter identifier that's used to build a table of contents from TC fields. Use the MarkEntry method to mark entries to be included in the table of contents. True if Table of Contents Entry (TC) fields are used to create the table of contents. Corresponds to the ending value used with the \o switch for a Table of Contents (TOC) field. The ending heading level for the table of contents. Corresponds to the starting value used with the \o switch for a Table of Contents (TOC) field. The starting heading level for the table of contents. True to use built-in heading styles to create the table of contents. The table of contents replaces the range, if the range isn't collapsed. Step 1: Add a title on the table of contents page. The range where you want the table of contents to appear. Once the table of figures is selected, head over to the References tab and click Update Table. Once you’ve done that, follow these steps to insert a table of contents in MS Word automatically. A variable that represents a ' TablesOfContents' collection. Add ( Range, UseHeadingStyles, UpperHeadingLevel, LowerHeadingLevel, UseFields, TableID, RightAlignPageNumbers, IncludePageNumbers, AddedStyles, UseHyperlinks, HidePageNumbersInWeb, UseOutlineLevels)Įxpression Required. It will be added to your table of contents, nested underneath the appropriate chapter heading.Ĭlick here to watch this video on YouTube.Returns a TableOfContents object that represents a table of contents added to a document.Highlight it and click Heading 2 at the top of your screen. To create a subheading in your table of contents, create the subheading in your document.You’ll see that both of your changes are reflected in the table of contents.Ĭreating subsections in your table of contents.Click on the dropdown menu and click Update Table > Update entire table to refresh it. Once you’re down with all your changes, head up to the top of your document and find your table of contents.Or, for instance, let’s say you want to change the title of Chapter 3.You can add in another chapter title, highlight it, and click Heading 1. For instance, say you write another chapter to your book.And now you have a brand new automatic table of contents!.Next, click References > Table of Contents. From there, you can select a style you like for your table of contents.Since we want this near the start of our document, right after the title page, we’ll place the cursor there now. Next, let’s pick a place to insert a table of contents.Highlight these titles and click Heading 1 at the top of your screen.We’re going to place some chapter titles at the start of various sections. To create a table of contents in Microsoft Word, the key is to apply heading styles to text that you want to be linked to in the table of contents. If you’ve written a long, unwieldy Word document that’s difficult to navigate, creating a table of contents can be very useful for organizing your content.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |