Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
OLE and MS-Word95
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00020239
Message ID:
00020257
Views:
33
>Hi and ...... HELP!
>I've been reading about OLE automating Word to open a document for editing.
>I'm storing Word Document Names in a table (they're names of memos, activity reports, etc.).
>
>I've tried things like
> =getobject("mymemo.doc") and
> =createobject("Word.Basic")
>
>and all this kind of stuff that goes with it.
>But I can not get Word95 to start and load my document for editing! Ugh!
>If I set a variable 'mvar' to my doc name,
>
>mvar="mymemo.doc"
>
>What code do I have to do next so the next thing I see is my document in MS-Word95??
>
>Help would be GREATLY appreciated!
>

I don't know if this is the "correct" way to do it, but I'm working with the same issues right now. I am doing the following:

oWord = CREATEOBJ( "Word.Basic" )

** You now have access to word basic
** Issue commands to load file and such

oWord.FileOpen( "filename.doc" )
oWord.AppShow() && Word now shows up and user can interact

**
** Not sure how yet, but need to wait until user has completed edit
** Probably should find a way to remove FileQuit from the menu as well
**

oWord.AppHide() && Word is now gone from the task bar and screen

** other automation type stuff
**
oWord.Close(1) && 1 = save, 2 = don't save

oWord.AppClose
========================
I'm not yet sure what to do to wait until the user has completed interaction, but this should work. There is probably a more correct way, and if anyone else has any input on this I'd appreciate it...

Thanks and good luck John
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform