I'm developing an application which uses VB for OLE Automation to MS Word 6.0c.
I'm pulling bookmark information from a document so that my application can
"follow along" as the user moves through a context-tagged Word document,
providing over-the-shoulder advice for modifying document content based on
I build an array of the bookmarks in the document, and periodically (every half
second at this point) do a cmpBookmark with OLE to see which bookmark(s) the
cursor is located in. No problem there. The problem is that, depending on how
much RAM is in the system on which it's running, I eventually (5-10 min. max.) get
an "OLE Automation Error - Out of Memory" from VB. It terminates, and leaves me
with a Word dialog saying "Out of Memory - save your file and exit Word."
I've tried moving the wdBasic method call into a separate procedure, to ensure
object is released each time. I've tried reducing the number of bookmarks to
free resources. (In development, I was using about a dozen. Live data has 95,
and for testing purposes, I trimmed that down to about 55, and the problem
Does anybody know of any memory leaks in Word's OLE automation, or problems
with OLE automation that would cause this, preferably problems that have
Help would be appreciated; please copy me by e-mail if possible, since I only get
into the newsgroups every couple days.