-
New VB user needing HELP!... .
Using VB5 to control Word, which I am using as an HTML editor. Opening Word once using CreateObject, then opening numerous existing documents [.htm 's] (one after the other). Each document is opened as follows:
Set MyDoc = ObjWordApp.documents.open FileName:="C:\MyFile"
On each document I: find & replace, Save changes, and set all object variables to nothing (except the Word Application Object, which I set to nothing at the very end of looping through all the documents).
Works fine for 30/50 documents, but repeatedly crashes on larger numbers. What could I be doing wrong? Memory is the issue, but I release all object variables..... I make considerable use of find and replace - could this somehow be consuming memory?...
HELP!
-
No answer yet
as to why word sucks up all memory when running over 2500 files w/ 115mb RAM. Creates thousands of HANDLES, however and I'm not sure what exactly that means but thousands of anything can't really be that good
-
OK. You know it is memory related, so try destroying (and then re-creating) the instance of the Word application after dealing with each document. If that solves your problem, you can start breaking the problem down into more manageable chunks (i.e. Close Object after 10 files etc.).
Does VB5 support early binding with Word references? It is MUCH quicker.
Cheers,
P.