WD2000: Out of Memory Errors Updating Table of Contents

ID: Q240410


The information in this article applies to:
  • Microsoft Word 2000


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 is usually caused 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


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. Place your insertion point in the table of contents and press F9 to update it after running the above macro.


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.


MORE INFORMATION

For more information about using the sample code in this article, click the article number below to view the article in the Microsoft Knowledge Base:

Q212536 OFF2000: How to Run Sample Code from Knowledge Base Articles

Additional query words:

Keywords : kbdta wd2000
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbbug


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