Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Work with only one Instance of Word
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00658782
Message ID:
00658787
Views:
24
Hi Elgin,

GETOBJECT() function works with an existing instance of the object. You can try to use next code to handle OLE-error:

LOCAL lcOldError, loApp
lcOldError=ON('ERROR')
ON ERROR loApp=NULL
loApp=GETOBJECT(,'Word.Application')
ON ERROR &lcOldError
IF ISNULL(loApp)
loApp=CREATEOBJECT('Word.Application')
ENDIF
Vladimir Trukhin
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform