WD2000: How to Write a Macro That Creates a Table of Contents Entry Automatically (211463)
The information in this article applies to:
This article was previously published under Q211463 SUMMARY
The following sample macro allows you to designate selected text as a table of contents entry without removing the text from the body of the document and without having to type the table of contents entry twice.
NOTE: Microsoft Word does provide a method to mark table of contents entries. To do this, select the text that you want to mark as a table of contents entry, press ALT+SHIFT+O. However, you can also use the macro described in this article.
REFERENCESFor more information about Table of Contents Entry fields, click Microsoft Word Help on the Help menu, type Field codes: TC (Table of Contents Entry) field in the Office Assistant or the Answer Wizard, and then click Search to view the topic. For more information about adding a command to a menu, click Microsoft Word Help on the Help menu, type Add a command or other item to a menu in the Office Assistant or the Answer Wizard, and then click Search to view the topic. For additional information about creating custom toolbars and buttons, click the article number below
to view the article in the Microsoft Knowledge Base:
191178 WD2000: How to Create Custom Toolbars, Toolbar Buttons
For additional informationabout getting help with Visual Basic for Applications, click the article numbers below
to view the articles in the Microsoft Knowledge Base:
212623 WD2000: Macro Programming Resources
226118 OFF2000: Programming Resources for Visual Basic for Applications
Modification Type: | Major | Last Reviewed: | 8/30/2002 |
---|
Keywords: | kbdtacode kbhowto KB211463 |
---|
|