WD2000: Error Message: "Word Has Insufficient Memory" When You Update Table of Contents (240410)
The information in this article applies to:
This article was previously published under Q240410 SYMPTOMS
When you edit your document and update your table of contents, you may receive the following error message:
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 problem usually occurs when you delete and reinsert the table of contents.
WORKAROUND
To work around this problem, you must remove the hidden bookmarks in your Word document and then update or replace your table of contents. To do this, follow these steps:
- Use one of the following methods to remove the hidden bookmarks from your Word document.
Method 1: Delete the Hidden Bookmarks- On the Insert menu, click Bookmarks.
- In the Bookmark dialog box, click to select the Hidden bookmarks check box.
- In the Bookmark name list, click to select a hidden bookmark, and then click Delete.
NOTE: A hidden bookmark name appears that is similar to the following example:
_Toc486730372 - Repeat step c to delete each hidden bookmark in your Word document.
Method 2: Run a Macro to Remove the Hidden BookmarksMicrosoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers 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 requirements.
For more information about how to use the sample code in this article, click
the article number below to view the article in the Microsoft Knowledge
Base:
212536
OFF2000: How to Run Sample Code from Knowledge Base Articles
Create and run the following macro to automatically delete each of the hidden bookmarks in your Word document:
Sub StripHiddenBookmarks()
Dim i As Long
ActiveDocument.Bookmarks.ShowHidden = True
For i = ActiveDocument.Bookmarks.Count to 1 Step -1
If Left$(ActiveDocument.Bookmarks(i).Name, 4) = "_Toc" Then
ActiveDocument.Bookmarks(i).Delete
End If
Application.ActiveDocument.UndoClear
Next i
ActiveDocument.Bookmarks.ShowHidden = False
End Sub
NOTE: When you use this macro, you may be prompted a few times with the error message listed in the "Symptoms" section of this article. Click Yes to continue the macro.
- Use one of the following methods to update or replace your table of contents.
NOTE: Before you use any of the following methods to update or replace your table of contents, use one of the methods listed in step 1 of this article to remove the hidden bookmarks in your Word document.
Method 1: Update the Table of Contents- Place your insertion point in the table of contents, and press F9.
- In the Update Table of Contents dialog box, click to select Update entire table and then click OK.
Method 2: Replace the Table of Contents- On the Insert menu, click Index and Tables.
- On the Table of Contents tab, select how you want your table of contents to appear. Then click Options.
- In the Table of Contents Options dialog box, click to select how to build your table of contents (Build table of contents from: Styles or Table entry fields or both).
- Click OK to close the Table of Contents Options dialog box.
- Click OK to close the Indexes and Tables dialog box.
- Click Yes to the following message:
Do you want to replace the selected table of contents?
Modification Type: | Major | Last Reviewed: | 6/17/2005 |
---|
Keywords: | kbdta kbfield kbmacroexample kbnofix kbprb kbwordvba wd2000 KB240410 |
---|
|