Cập nhật thông tin chi tiết về How To Create And Manage A Table Of Contents In Microsoft Word mới nhất trên website Trucbachconcert.com. Hy vọng nội dung bài viết sẽ đáp ứng được nhu cầu của bạn, chúng tôi sẽ thường xuyên cập nhật mới nội dung để bạn nhận được thông tin nhanh chóng và chính xác nhất.
Using a table of contents in your document makes it easier for the reader to navigate. You can generate a table of contents in Word from the headings used in your document. Here’s how to do it.
Add a Table of Contents
Regardless of the size of your document, using a table of contents can direct the reader to exactly where they need to be. In addition to making the document more reader-friendly, a table of contents also makes it easier for the author to go back and add or remove content if necessary.
By default, Word generates a table of contents using the first three built-in heading styles (Heading 1, Heading 2, and Heading 3). To apply heading styles, select the particular style from the “Home” tab. If you’re not happy with the types of heading styles available, you can change the default heading style.
You can manage this in two different ways. You can either apply the heading styles to each section after you’ve finished the document, or you can add them as you go.
Once you’ve applied your heading styles, it’s time to insert your table of contents. The first thing you need to do is put the cursor where you want the table of contents to appear. Once ready, head over to the “References” tab and select “Table of Contents.”
Advertisement
A drop-down menu will appear. Here, you can choose between the three different built-in tables.
The only difference between Automatic Table 1 and 2 is the title, which is “Contents” and “Table of Contents,” respectively. Selecting either Automatic Table 1 or 2 will create the table of contents using the names of the headings.
If you chose the “Manual Table” option from the “Table of Contents” drop-down menu, then it will insert a template for you that you will need to edit yourself.
You may notice in this table of contents that there are sub-levels. Each level represents a heading style in your document. So if you use the automatic table and you want sub-levels in your ToC, you will need to use heading 1 for level 1, heading 2 for level 2, and heading 3 for level 3.
Advertisement
Updating the Table of Contents
Your table of contents will now be updated.
Removing the Table of Contents
At the bottom of the drop-down menu, select “Remove Table of Contents.”
Your table of contents will now be removed from your document.
How To Create A Table Of Contents In Microsoft Word
How to create a Table of Contents
Apply the built-in Heading styles to the headings in your text.
Creating a table of contents in a Microsoft Word document is a two-step process. First, identify the text that you want to appear in the Table of Contents. Second, tell Word to insert the Table of Contents. Having created your Table of Contents, you can then customize it in several ways, to suit your needs.
On this page
Identify the text that you want to appear in the Table of Contents
If these don’t appeal to you, there are several other ways to apply a style.
In the same way, apply the Heading 1 style to other major headings in your document. Apply the Heading 2 style to sub-headings, Heading 3 style to sub-sub-headings etc.
If you don’t like the way the heading styles look (eg, you want a different font or font size or colour), don’t format the text directly. Instead, modify the heading styles.
Create the Table of Contents
Word 2003 and earlier versions
Display the Table of Contents dialog. To do that:
Word 2007 and Word 2010
Choose one of the following items on the menu.
There is a built-in “Manual Table”. This takes you back to the era of the electric typewriter. If you like typing things out for no good reason and your life expectancy is a lot longer than mine, this is for you.
At the bottom of the menu, you can choose Insert table of contents. This displays the Table of Contents dialog that was also in earlier versions of Word. If you want two or more tables of contents in one document, you must choose this option for at least the second and subsequent tables of contents.
Using a table of contents content control in Word 2007 or Word 2010
You can use the content control to manage your table of contents (Figure 1).
Figure 1: A table of contents in a content control
If you attempt to insert another custom or built-in table of contents that will be placed in a content control, then the new one will over-ride the existing one. If you want more than one table of contents in a document, use the “Insert table of contents” menu option for all, or at least the second and subsequent, tables of contents.
How to create a custom table of contents and have it appear on the Table of Contents menu in Word 2007 or Word 2010
Insert your table of contents into any document, and adjust it to suit your needs.
Add text above and/or below the table of contents as required (for example, add a heading “Table of Contents”, preferably formatted with the built-in TOC Heading style).
Select the text above, the table of contents, and the text below.
In the Create New Building Block dialog:
give your table of contents a name
in the Gallery list, choose Table of Contents
in the Category list, choose ‘Create new category’ and name your new category
Word displays entries in the menu in alphabetical order by category. Sadly, there are few letters in the alphabet before the “B” for “Built-In”. If you want your custom tables of contents to appear before the Built-In category, but there is no name between “A” and “Built-In” that suits you, then put a space at the beginning of the category name. For example, name your category ” Shauna”. A space is alphabetized before a letter, so ” Shauna” will be displayed before “Built-In”.
Customize the Table of Contents (if you need to)
How to change the look of the headings in the document
Use the Document Map
How to change the look of the Table of Contents itself
To modify the Table of Contents itself, you need to display the Table of Contents dialog. To display the dialog for an existing table of contents:
From the Table of Contents dialog you can modify the Table of Contents in several ways.
By default, Word shows three levels in your Table of Contents. That is, it puts the text from Heading 1, Heading 2 and Heading 3 in the Table of Contents. If you want to show more or fewer levels, in the Table of Contents dialog, change the number in the Show levels box.
For sophisticated customization, you can edit the switches in the TOC field.
How to create a table of contents for several documents
To create one table of contents for several documents, you need to do the following.
Create a separate document to hold the table of contents (we’ll call this “the ToC document”).
For ease, put all the documents, and your ToC document, in the one folder.
In your ToC document, use an RD (Reference Document) field for each document that you want to include in your Table of Contents.
To insert an RD field, do ctrl-F9 and, within the brackets that Word gives you, type RD “filename“. For example { RD “Chapter 1.docx” }. You can’t type the curly brackets by hand. You must do ctrl-F9.
If you can’t put all your files in one folder, you must use double backslashes and double quotes. For example, { RD “C:\My folder\Chapter 1.docx” }.
Add an RD field for each document that you want to reference, in order.
Create the Table of Contents in this ToC document in the usual way.
Remember the page number rule: “The Table of Contents will pick up whatever pagination appears in your document”. It applies when using RD fields to create a ToC for many documents. You may have to set the starting page number manually in each document if you want pagination to run consecutively through your project.
Other tips about Tables of Contents
If you have Word 2003, Microsoft has some great online training about Tables of Contents available for free. See
A Table of Contents is a field, not ordinary text. To see fields in your document, you can tell Word to display fields with grey shading. The grey doesn’t print, but it reminds you that this is a field, not ordinary text. To display fields with grey shading:
Tables of Contents don’t update automatically when you add a new heading to your document. This is because a ToC is a field. To update a Table of Contents, put your cursor in the Table of Contents and press F9 to update it. Or ctrl-a F9 to update all fields in the document. In Word 2007 and Word 2010, if your table of contents is in a content control, you can use the content control to update the ToC.
When you update your Table of Contents, always choose to update the Entire Table (Figure 2).
Figure 2: Whenever you see this box, always choose the second option and update the entire table.
The Table of Contents will pick up whatever pagination appears in your document. To control page numbers, see How to control the page numbering in a Word document at the Word MVP FAQ site
If the tabs in your Table of Contents seem to have gone crazy, see Whenever I update my Table of Contents it acquires unwanted tabs, and I have to press Ctrl+Q to get rid of them at the Word MVP FAQ site
To solve the problem, select the whole of the Table of Contents (selecting a few paragraphs either side is OK). Do Shift-F9. You’ll see the field codes exposed, and they’ll look something like { TOC o “1-3” h z }. Edit these codes to remove the h. Press F9 again to re-generate the ToC and hide the field codes. (By the way, you can’t type the curly brackets yourself. If won’t work. If you want to type out the field codes manually, use ctrl-F9 to create the curly brackets.)
Note: It is also possible to create a Table of Contents by marking each individual paragraph that you want to appear in the ToC. Then, you tell Word to use your marked paragraphs to create the ToC. You do this using { TC } fields. It seems to me that the chance of human error in accidentally omitting to mark a heading is large. I wouldn’t risk it. But if you’re interested, look at Word’s help under TC.
Related pages
How to number headings and figures in Appendixes in Microsoft Word – includes information on creating a table of contents when you have appendixes in your document
How to use the Document Map in Microsoft Word – the Document Map roughly mirrors your table of contents
How To Create Macros In Microsoft Word 2022 And 2022?
Applicability: Word 365, 2019, 2016; Windows and MAC OS X operating systems.
Here’s a question from a reader::
Enabling the developer tab in Word
If you don’t see the Developer tab in your Microsoft Word Ribbon, you’ll need to setup your Macro development environment.
Open a new Word document. In case that you would like to work on an existing file, ensure that you have a copy for backup, before making any changes.
Now, go ahead and make the developer menu visible in the Ribbon.
Recording a Word Macro – a practical example
Now, hit the newly added Developer tab.
Go to the Code button group.
Note: Although it’s possible to assign Macros to buttons , for simplicity we’ll run Macro manually via the View tab or Developer tabs.
Execute the sequence of steps you would like to record. In this case, you’ll record the following steps:
Select a specific paragraph in your document.
Go to the Home tab.
Set the font to Times New Roman.
Set the Font Size to 16.
Center your Text by hitting Ctrl +E.
Once Done, return to the Developer tab and hit Stop Recording.
Now let us take a look at the auto-generated VBA code. Hit Macros and then highlight the AutoFormat Macro and hit Edit.
Close the VBA Editor.
Save your work in a Word Macro enabled template
In the Save As dialog right hand side, determine your saving location and provide a meaningful name to your Workbook.
Choose Word Macro Enabled Document as your document type. Note: Your Word document will be saved with the .docm suffix.
Hit the Save Button.
Executing your macro
Open your Word document.
Select the Paragraph you would like to automatically format. Just as an example, here’s the paragraph i chose:
Go to the View tab.
Hit the Macros button.
Select your AutoFormat Macro
Hit Run – this will apply the macro on the selected paragraph.
Assigning your Macro to Buttons or keyboard shortcuts
Note: This is an optional step that should be attempted after you have followed the Macro recording tutorial above.
OK, so far we got our Macro basics working. Now it’s time to improve a bit our Macro usability in the Word doc. Let me show you how you can associate your Macro with a quick access button, so you can launch it more easily.
The Word Options dialog will come up.
In the Choose commands from dropdown, select Macros.
Hit the Modify… button to define a suitable icon for your Macro.
Define a Display name for your button.
Hit OK.
Now, you can launch your Macro from the Quick Access Toolbar, just above the Ribbon.
Note: You are able to associate your Word Macro not only with quick access buttons but also with command buttons embedded in your document and specific custom keyboard shortcuts.
Creating Word Macros using VBA
With some simple Visual Basic for Applications coding skills we can edit the macros and write programs to automate various kinds of works using VBA.
Aside Note: FYI – some of the Microsoft Office applications, such as Powerpoint and Outlook, do not have built in macro recorders. Therefore, writing VBA is mandatory for writing Powerpoint macros and automating Outlook.
The Visual Basic for applications editor will open up.
Let’s assume that we want to manually edit the Macro we have recorded in the previous step, so that Word not only set the Size, font and alignment of the paragraph, but also the color.
Setting the color of a section is achieved using the following VBA command:
[code] Selection.Font.Color [/code]
In our case, we’ll want to set it to a random blue, so we’ll append the following snippet to our Recorded macro:
[code] Selection.Font.Color = 16737792[/code]
Here’s how your VBA code should look like:
In the VBA Editor hit File and then Save.
Back to your document, run your Macro on a paragraph and observe the font color change.
Useful Word Macro example you can write
Since publishing this tutorial, many readers asked for more in depth examples of Word Macros. This list covers the most prevalent tasks you can automate using Visual Basic in Word. Here we go:
Create and Save New Document
Sub CreateNewDoc() 'This small snippet first creates a new document, then it checks whether a document with the same name already exists before saving. Dim myDoc As New Document Dim filePath As String 'Modify your file path as needed filePath = "C:MyNewDoc.docx" Set myDoc = chúng tôi With myDoc If Dir(filePath) = "" Then .SaveAs2 (filePath) Else 'You have already an existing document MsgBox ("Please use a different file name") End If End With myDoc.Close SaveChanges:=wdPromptToSaveChanges End SubOpen a Word document with VBA
Sub OpenDoc() 'This code checks whether your document exists and then opens it filePath = "C:MyNewDoc.docx" If Dir(filePath) = "" Then MsgBox ("file doesn't exist") Else chúng tôi (filePath) End If End SubClosing one/all open documents
Sub CloseDoc() 'This code closes a specific document filePath = "C:MyNewDoc.docx" Documents(filePath).Close SaveChanges:=wdPromptToSaveChanges End Sub Sub CloseAllDocs() 'This code closes all opened documents in your computer Documents.Close SaveChanges:=wdPromptToSaveChanges End SubSaving Word as PDF
Here’s how to easily automate saving of Word documents as PDF files.
Sub SaveAsPdf() 'This code saves a word document in a PDF format FileName = Left(CStr(ActiveDocument.Name), Len(CStr(ActiveDocument.Name)) - 5) ActiveDocument.SaveAs2 FileName:="c:" + FileName + ".pdf", FileFormat:=wdFormatPDF End SubInserting header and footer
This code sets the header and footer of your Word document first page.
Sub InsertHeaderFooterFirstPage() Dim myDoc As Document Dim headerText As String Dim footerText As String Set myDoc = ActiveDocument 'Replace the header and footer text as needed headerText = "This document was written by you" footerText = "All rights reserved to you" With myDoc.Sections(1) 'We first ensure that we can set different header and footer texts .PageSetup.DifferentFirstPageHeaderFooter = True 'Setting the header and footer texts .Headers(wdHeaderFooterFirstPage).Range.Text = headerText .Footers(wdHeaderFooterFirstPage).Range.Text = footerText End With End SubAdditional Word Macro ideas
Here are a few more ideas which we’ll be posting in the upcoming future.
Find and Replace (Execute Method)
Insert a paragraph (before and after a selection)
Printing documents programatically
Working with tables
This concludes our tutorial for today. As you just saw, there is a lot to be done with the Word macro recorder and VBA Macros in Word. In case you are looking for more specific help that goes beyond the scope of this tutorial, kindly contact us via our contact form.
How To Format Microsoft Word Tables Using Table Styles
Apply and Modify Table Styles in Word Documents
Applies to: Microsoft ® Word ® 2013, 2016, 2019 or 365 (Windows)
You can apply table styles to your Word tables to format them quickly and consistently. Word is shipped with several built-in table styles or you can create your own. You can edit table styles by modifying borders, shading, character formatting, paragraph formatting and table properties. If your document includes multiple tables, table styles can save a lot of time.
Note: Buttons and Ribbon tabs may display in a different way (with or without text) depending on your version of Word, the size of your screen and your Control Panel settings. For Word 365 users, Ribbon tabs may appear with different names. For example, the Table Tools Design tab may appear as Table Design.
Recommended article: How to Keep a Microsoft Word Table Together on One Page
Table styles and themes
Every Word document uses a document theme which includes a font theme and color theme. The colors used in table styles are based on the color theme.
You can select document themes, color themes and font themes using the Themes, Colors or Fonts drop-down menus on the Design tab in the Ribbon:
Turning gridlines on
When you are working with tables, it’s a good idea to turn gridlines on. Borders, which are a format, will print. Gridlines do not print.
To turn on gridlines:
If your Word document contains multiple tables that you want to format in a consistent way, it’s best to use table styles rather than applying manual or direct formatting to each table.
To apply a table style to a table:
Hover over the various table styles. The table formatting will change as you move over different table styles in the gallery.
Below is the Table Styles gallery (the current theme is the Office theme):
Selecting Table Style Options
Once you have selected a table style, you can select different Table Style Options (which are affected by the formats in the table style).
To select Table Style Options:
In Table Style Options, check or uncheck Header Row. If this option is checked, the header row will be formatted differently from the body rows.
In Table Style Options, check or uncheck Total Row. If this option is checked, the last row will be formatted differently from the body rows.
In Table Style Options, check or uncheck Banded Rows or Banded Columns for alternate row or column shading.
In Table Style Options, check First Column or Last Column if you want the first or last column formatted differently from the other columns.
You can modify a table style in a Word document and all tables using that table style will change.
To modify a table style:
From the Apply Formatting to drop-down menu, select the element that you want to modify (such as Header row).
Select the desired formatting such as font, font size, font color, fill and border.
From the Apply Formatting to drop-down menu, select the next element that you want to modify.
Select the desired formatting such as font, font size, font color, fill and border.
Repeat for other elements.
Select Only in this document or New documents based on this template. If you select Only in this document, the modified style will only be available for the current document. If you select New documents based on this template, then the table style will be modified for future documents based on the current template (usually the Normal template).
Below is the Modify Style dialog box:
You can also modify Table Properties in a table style. Table properties include table alignment, row settings and cell margins.
To modify Table Properties in a table style:
Select any other formatting options you want to apply to the entire table.
Select Only in this document or New documents based on this template.
Below is the Table Properties dialog box with the Table tab selected:
You can also create a new or custom table style.
To create a custom table style:
Enter a name for the new table in the Name box.
Select the desired formatting.
Select Only in this document or New documents based on this template.
New Table Style appears at the bottom of the Table Styles gallery:
Clearing a table style
To clear a table style and remove formatting:
Clear appears at the bottom of the Table Styles gallery:
You can also set a default table style for new tables in the current document or all new documents.
To set a default table style:
Select This document only or All documents based on the chúng tôi template (the default template in Word is the Normal template).
If you are working with documents with multiple tables, formatting with table styles can ensure that your tables are formatted consistently and save a lot of time.
Did you find this article helpful? If you would like to receive new articles, join our email list.
More resources
10 Microsoft Word Tips, Tricks and Shortcuts for Selecting in Tables Microsoft Word Tricks to Keep Text Together (Words, Lines or Paragraphs) 14 Shortcuts to Quickly Select Text in Microsoft Word
Related courses
Bạn đang xem bài viết How To Create And Manage A Table Of Contents In Microsoft Word trên website Trucbachconcert.com. Hy vọng những thông tin mà chúng tôi đã chia sẻ là hữu ích với bạn. Nếu nội dung hay, ý nghĩa bạn hãy chia sẻ với bạn bè của mình và luôn theo dõi, ủng hộ chúng tôi để cập nhật những thông tin mới nhất. Chúc bạn một ngày tốt lành!