
Does anybody know "IsNothing()"?
Quote:
>-----Original Message-----
>Hi there,
>I've got the problem to find out, if an object variable is
>set to nothing. Word 2000 help claims that there is a
>function called "IsNothing(<ObjectVar>)" which should
serve
>the purpose which I need, but when I write a call to
>IsNothing into my VBA source, I get an error message that
>"IsNothing" is unknown!
>Comparing an object variable to Nothing is not possible,
>either. So what can I do?
>Any suggestions appreciated!
>Thanks,
>Daffy
>.
Okay, I found the answer to my question myself! But just
for anybody, who might have the same problem - here is the
solution:
1. The function "IsNothing" which is mentioned in the
online help, is a bug!!! (-> MS-Knowledgebase told me so)
2. To find out if an object variable is set to nothing you
can do the following:
If TypeName(<objVar>) = "Nothing" Then...
or if you want to know if an object is NOT set to nothing:
If TypeName(<objVar>) <> "Nothing" Then...