test the return value of aFolder.items.find(filter) method 
Author Message
 test the return value of aFolder.items.find(filter) method

Hello,

How to test if the "myItem = aFolder.Items.Find(filter)" method has found
something or not.
If i test the myItem (=Nothing or not), the compilator doesn't accept. Why?
How to test the myItem value? Will i be forced to use exceptions?

Thank's for your help.
Didier



Sat, 08 Nov 2003 05:52:03 GMT  
 test the return value of aFolder.items.find(filter) method
It's ...

    If MyItem Is Nothing Then

... or ...

    If Not MyItem Is Nothing

You can also use the TypeName() function.

--

Sue Mosher, Outlook MVP
Author of
     Teach Yourself Microsoft Outlook 2000 Programming in 24 Hours
     Microsoft Outlook 2000 E-mail and Fax Guide
Outlook and Exchange solutions at http://www.slipstick.com


Quote:
> Hello,

> How to test if the "myItem = aFolder.Items.Find(filter)" method has found
> something or not.
> If i test the myItem (=Nothing or not), the compilator doesn't accept.
Why?
> How to test the myItem value? Will i be forced to use exceptions?

> Thank's for your help.
> Didier



Sat, 08 Nov 2003 06:23:43 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Help Please - .Find method will not return the first value in a table

2. How to test if a filter returns no tasks

3. Testing to see if a filter found any matches

4. return of ADODB.Recordset.Filter if no record find

5. Filter syntax for item.find

6. Items.Find Filter

7. Filter property on Find method

8. Filter-string with single/double quotes in Restrict/Find method

9. Find method -- problem with filter

10. Find/Filter method problem

11. TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST

12. How to test for a NULL return value from FindByValue in vb.net

 

 
Powered by phpBB® Forum Software