Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP 6.0 and Word97
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00155685
Message ID:
00155785
Views:
23
I'm not using NewObject, I use GetObject() instead. GetObject() activates an OLE automation object and creates a reference to the object.

loWord = GetObject(, "Word.Application")

IF (Type("loWord") = "C") AND Empty(loWord)
*-- Error
ELSE
*-- Do some work here
ENDIF

GetObject() return an empty string if an error occurs.

HTH

>That is what I am trying to avoid. Although it seems like the only way.
>
>On another note can you tell how you initialize your OLE call to Word97? I am currently using the following:
>
>oWord = NewObject( "Word.Application" )
>oWordDoc = NewObject( "Word.Document" )
>
>The oWord object can be a problem if for some reason Word is already active. Although it would not fail, it would return an invalid object.
Previous
Reply
Map
View

Click here to load this message in the networking platform