Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Closing word 2002 from VB6after printing a document

Status
Not open for further replies.

Dreloch

Programmer
Dec 17, 2003
19
US
I am currently using a word template to produce a document populated from VB6. The template was originally run and created in word 97. The flow is that if word was not originally running, it gets closed after printing the document. I am using:

myWord.Quit savechanges:=wdDoNotSaveChanges

to close word without saving the document. This works when word 97 is on the PC that is running the app, but if word 2002 is used, word locks up. Does anyone know of a command that is compatable to both?

 
It sounds like you are setting the reference in the IDE to the microsoft word x.x library (i forget what version office 97 is)

try dimming myWord as an object and creating the object as follows

Code:
Dim myWord as object
Set myWord = CreateObject("Word.Application")

its a sod for writing because you lose the intelisense but you can set up your ide to use the reference to 97 inside the ide and createobject on the released version

If somethings hard to do, its not worth doing - Homer Simpson
 
I was able to have it shut down word properly if I set myword.printout Background:=False. It seems to close properly after changing this setting in both Word 97 and 2002.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top