>Hello,
>
>I have a program that converts all .TXT output into .DOC format. If the user has the Word Applicatin left open in his/her desktop (and working on his/her documents while the program is running) how may I have the active documents created by the program while executing invisible? I tried oWord.ActiveDocument.Visible = .F. but I got an error message (0x80020006). I tried oWord.Visible but then it wouldn't let the user continue working on his/her document (nothing to do with the program). I tried CreateObject to open another Word Application but then the program (oWord.Quit) wouldn't properly close it upon completion.
>
>How may I allow the user continue working in their Word Application while the program is running behind the scenes?
>
>TIA...
Dodi,
I think you used GetObject(). IMHO never use GetObject() with word,excel etc. Instead use CreateObject() and call quit saving your changes. ie:
#DEFINE wdSaveChanges -1
LOCAL oWordDocument as "word.application"
oWordDocument=Createobject("word.application")
With oWordDocument
.documents.Add
.ActiveDocument.SaveAs("c:\mypath\myFile.doc")
.Quit(wdSaveChanges)
Endwith
Another easy way is to do that without automation. Just change extension to .doc.
Cetin