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.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement