WD97: Out of Memory Errors Updating Table of Contents

ID: Q244590


The information in this article applies to:
  • Microsoft Word 97 for Windows


SYMPTOMS

When you edit your document and update your table of contents, the following error message may appear:

Word has insufficient memory. You will not be able to undo this action once it is completed. Do you want to continue?


CAUSE

There are too many hidden bookmarks in the document. This usually occurs when you delete and reinsert the table of contents.

This problem only occurs when the document was originally created in Word 6.0 for Windows or Word for Windows 95.


WORKAROUND

Use one of the following methods to work around this problem:

Method 1: Replace the Table of Contents with a New One

  1. Place your insertion point in the table of contents, and press F9 to update it.


  2. Click Index and Tables on the Insert menu, and insert a new table of contents. Click Yes to replace the existing table of contents.


Method 2: Delete the Hidden Bookmarks

  1. On the Insert menu, click Bookmarks.


  2. Select the Hidden Bookmarks check box.


  3. Delete all of the hidden bookmarks.


  4. Place your insertion point in the table of contents, and press F9 to update it.


Method 3: Run a Macro to Remove the Hidden Bookmarks

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 a Microsoft Certified Solution Provider or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Solution Providers, please see the following page on the World Wide Web:

http://www.microsoft.com/mcsp/
For more information about the support options available from Microsoft, please see the following page on the World Wide Web:

http://www.microsoft.com/support/supportnet/overview/overview.asp

For additional information, please see the following article in the Microsoft Knowledge Base:
Q173707 OFF97: How to Run Sample Code from Knowledge Base Articles

Sub StripHiddenBookmarks()
   Dim stBookmark As bookmark
   ActiveDocument.Bookmarks.ShowHidden = True
   For Each stBookmark In ActiveDocument.Bookmarks
      If Left$(stBookmark.Name, 4) = "_Toc" Then
         stBookmark.Delete
      End If
   Application.ActiveDocument.UndoClear
   Next stBookmark
   ActiveDocument.Bookmarks.ShowHidden = False
End Sub 
NOTE: When using this macro, you may be prompted a few times with the error message in the "Symptoms" section of this article. Answer "Yes" to continue the macro. After running the macro, place your insertion point in the table of contents, and press F9 to update it.


STATUS

This problem was corrected in Microsoft Word 97 for Windows. However, you may see the problem in any version of Microsoft Word if the document was originally created in Microsoft Word 6.0 for Windows or Microsoft Word for Windows 95.

Additional query words:

Keywords : kbdta word8 word97
Version : WINDOWS:97
Platform : WINDOWS
Issue type : kbbug


Last Reviewed: November 4, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.