Hi All:
While I've managed to fix the problem, I'm wondering if anyone else has any insight. I have a document of 589 pages with 954 Heading 1 styles. I have a macro which, among other things, sorts the headings alphabetically & regenerates the TOC. I started to get out of memory errors ("Word has insufficient memory") while my macro ran. I tried to count the number of headings with a macro, but got an Error 6 overflow message.

This used to happen when I used Word 6 & 95. The reason was that every time the TOC regenerated, it created new hidden bookmarks, but didn't delete the old ones. Word 97 & 2000 supposedly do not suffer from that problem, as both delete hidden TOC bookmarks. Nevertheless, the only way I was able to cure the problem was to run a macro that deleted all the bookmarks. I tried one that deleted only hidden TOC macros & that didn't solve the problem.

I suspect that perhaps it wasn't that I had too many hidden bookmarks, but that 1 or more was corrupt (because I had to delete all the bookmarks, including hidden cross-reference ones that weren't deleted by the first macro). Anyhow, I wonder if this has happened to anyone else using Word 2000 (or 97) or if anyone has some insight as to what happened. By the way, the document was only about 3.1MB (is now about 2.8MB).

Thanks in advance.