Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Word Application open in user's PC, how to...
Message
From
12/09/2006 06:59:27
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
11/09/2006 20:28:31
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
01152901
Message ID:
01152965
Views:
21
>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")	&& Create word object
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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform