WD: Unwanted Extra Line(s) in Table of Contents

ID: Q127744


The information in this article applies to:
  • Microsoft Word for the Macintosh, versions 6.0, 6.0.1, 6.0.1a
  • Microsoft Word for Windows NT, version 6.0
  • Microsoft Word for Windows 95, versions 7.0, 7.0a


SYMPTOMS

The results of a TOC (table of contents) field contain one or more extra, unwanted lines.

This problem occurs only if the headings in the document are formatted to use either automatic numbering or heading numbering AND if any part of the heading is also marked for an index entry. This problem occurs in Word for Windows 95, Word for Windows NT, and Word for the Macintosh. It does NOT occur with 16-bit Word for Windows running under Windows NT 3.5 or under Windows for Workgroups or Windows 3.1.

For example, headings formatted like this


   1.  Heading 1{XE "Heading 1"}
       1.1  Heading 2
            1.1.1  Heading 3 
generate a table of contents that looks like this:

   1. Heading 1..............................1
   1. .......................................1
      1.1 Heading 2..........................1
          1.1.1 Heading 3....................1 
Notice that there is an extra line in the table of contents under the line that contains the index entry. The extra line contains the same heading numbering as the line that contains the index entry, as if Word is trying to also number the index entry in the table of contents.


RESOLUTION

To resolve this problem, upgrade to the latest version of Microsoft Word.

To work around this problem, eliminate the extra lines in the table of contents. To do this, simply place the XE field at the beginning of the line of text rather than at the end. Do this for each XE field. For example:

  1. {XE "Heading 1"}Heading 1


When you update the table of contents by selecting it and pressing F9, the extra lines will be eliminated.

To automate the above process, create the following macro:

   Sub MAIN
      StartOfDocument
      ToolsOptionsView .FieldCodes = 1, .Hidden = 1
      EditFind .Find = "^19 xe", .Direction = 0, .Wrap = 1
      While EditFindFound()
      EditCut
      StartOfLine
      EditPaste
      EditFind
      Wend
   End Sub 


STATUS

Microsoft has confirmed this to be a problem in the versions of Word listed above. This problem was corrected in Microsoft Word 97 for Windows and Word 98 Macintosh Edition.


MORE INFORMATION

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:

http://www.microsoft.com/supportnet/refguide/

Additional query words: TOC format formatted wrong incorrect 32 bit extra number entry entries

Keywords : wordnt kbfield winword ntword macword word7 word95
Version : MACINTOSH:6.0,6.0.1,6.0.1a; WINDOWS:7.0,7.0a; winnt:6.0
Platform : MACINTOSH WINDOWS winnt
Issue type : kbbug


Last Reviewed: January 3, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.