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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only