Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
OLE -- WHAT AM I DOING WRONG??
Message
 
To
17/03/1998 12:47:17
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00084951
Message ID:
00085170
Views:
41
>>Mark,
>It opens several instances of Word & the docu at the same time, and reduces my system memory to the point of stopping the system. Now Cetin gave some tips that I am going to use in order to avoid this.

Mark,

What you need to do to prevent the multiple instances of word is to use a reference to the word object that persists. If this suttf is all happening in a single form you can in the Init;
 LOCAL lnChan
 lnChan = DDEInitiate("Word","System")
 IF lnChan < 0
    * Word is not running
    THISFORM.WordWasRunning = .F.
    THISFORM.oWord = CreateObject("Word.Basic")
 ELSE
    DDETerminate(lnChan)
    THISFORM.WordWasRunning = .T.
    THISFORM.oWord = GetObject("Word.Basic")
 ENDIF
Now anywhere in that form or any of its controls you can refer to THISFORM.oWord as a rerference to the word object. In the destroy of the form you can;
 IF NOT THISFORM.WordWasRunning
    THISFORM.oWord.FileExit()
 ENDIF
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform