-
Hi,
I've been using MS Word automation in my VB program and have made some mistakes, corrected them, and now the program works fine.
But now whenever I open up MS Word (on my own or thru my program), Document 19 is opened, not Document 1, like it used to. Do I have 18 other documents open elsewhere? Do I have processes still running?
-
<?>
when you use a word object you have to remember
to set it to nothing when finished.
set objWord = nothing
Could be your problem...
just reboot to see if you go back to one once
it clears memory.
-
Look in your task manager for open word processes.
Roger
-
i've tried rebooting so it's not cleared from memory
I'm looking in the task manager and could not find anything like winword.exe. Are there other word processes with different names I don't know about?
-
Try re-creating the word automation object. I could be set to load a blank document named Document 19. I don't have very much experience with automation objects but it seems logical.
-
Well everytime I run the program, I create a word automation object and everytime before the program ends the object is deleted. The problem started when I had an error mid-way thru the program (nothing to do with the automation object) and the program did not reach the statement that quits the object.
This 'Document 19' occurs all the time. Even if I just turn on my computer and open Word (I didn't even touch my program or VB). Document 19 appears, and not Document 1.
-
put error handlers in, and set the objects to nothing in them.
-
You can close the word process by calling the quit method of the Word.Application object.
But I don't think that will change anything on you actual 'document19-problem'. Take a look an your harddisk. Are there any files called from 'Document1.doc' to 'Document18.doc' in the standard document path of word?
Roger
-
My whole computer does not contain the files 'Document1.doc' ... 'Document18.doc'.
-
Try looking in the normal.dot isn't that the template for new documents? maybe just the title has changed...
Good luck
Jop