Microsoft KB Archive/240410

= WD2000: Error Message: "Word Has Insufficient Memory" When You Update Table of Contents =

Article ID: 240410

Article Last Modified on 6/17/2005

-

APPLIES TO


 * Microsoft Word 2000 Standard Edition

-



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.</ol>

Method 2: Run a Macro to Remove the Hidden Bookmarks
Microsoft 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. </li>  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
<ol style="list-style-type: lower-alpha;"> Place your insertion point in the table of contents, and press F9.</li> In the Update Table of Contents dialog box, click to select Update entire table and then click OK.</li></ol>

Method 2: Replace the Table of Contents
<ol> On the Insert menu, click Index and Tables.</li> On the Table of Contents tab, select how you want your table of contents to appear. Then click Options.</li> 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).</li> Click OK to close the Table of Contents Options dialog box.</li> Click OK to close the Indexes and Tables dialog box.</li> Click Yes to the following message:

Do you want to replace the selected table of contents?

</li></ol> </li></ol>

Additional query words: toc tableofcontents

Keywords: kbnofix kbmacroexample wd2000 kbdta kbprb kbfield kbwordvba KB240410

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.