

Select the area of the document that you want the table of contents to relate to and then click the INSERT Ribbon tab.
MAKE TABLE OF CONTENTS WORD DOCUMENT HOW TO
The following example shows how to create a custom table of contents that includes all text formatted with built-in styles Heading 1, Heading 2 and Heading 3 but omits page numbers from heading levels 1-3. The first step is to create the bookmarks. We can also create a custom table of contents and determine what entries to appear in the table of contents by using TOC switches. The heading level range must be from 1 to 9.ĭoc.saveToFile("createTableOfContents.docx", FileFormat.Docx) As you can see in the image below, the table of contents uses the heading styles in your document to determine where each section begins. Select a built-in table from the menu that appears, and the table of contents will appear in your document.
MAKE TABLE OF CONTENTS WORD DOCUMENT UPDATE
If you make changes to your document that affect the table of contents, update the table of contents by right-clicking the table of contents and choosing Update Field. Navigate to the References tab on the Ribbon, then click the Table of Contents command. Click Options to bring up the Field Options dialog box. On the Insert Menu, click Field, and then from the Index And Tables Category, click TOC. Place the insertion point where you want the Table of Contents for that section to appear. add a table of contents with default appearance by specifying lower heading level and upper heading level. Create the table of contents Put your cursor where you want to add the table of contents. To create the table of contents for the first section that you bookmarked, follow that steps: 1. Of course, that only separates the title page from the table of contents and if you want to insert other pages between those two, it wouldnt work. When use Add method could add a tablecontent for a word document file. You could create a table of contents manually, but it would be a real waste of time.

A collection of TableOfContents objects could represent the tables of contents in a document. Luckily, Word allows you to create a table of contents, making it easy to refer to the relevant sections of your document, and therefore it is a must-do task for document writers. If you make changes to your document that affect the table of contents, update the table of contents by right-clicking the table of contents and choosing Update Field. Tr.getCharacterFormat().setTextColor(Color.blue) 3 Answers Active Oldest Score 2 As explained here, based on this and this, you could change the style of the date in the Word document to add a page break after it. >I want to create table of content for word document and i want to get the content of this from page header and then to build the table. Put your cursor where you want to add the table of contents. Similarly, add hyperlinks to all the titles in the Table of contents. DO NOT use the headings bookmarks, instead choose the bookmarks created in previous steps.

TextRange tr = para.appendText("Table of Contents") There will be two options in the section Headings and Bookmarks.
