If not found?

  • Thread starter Thread starter vortex2k4
  • Start date Start date
V

vortex2k4

Couldnt really find a definitive answer on this group so thought I
would start a new topic.

I want to be able to use the find command to find a subject that is in
a folder from an array.

So far I have this : itms.Find ("[Subject] = ""Newmsgarray(i)""")

It finds no errors but im not sure if it is working or not.

I want to be able to do something if the subject in the array is NOT
found rather that if it IS found.

If you could tell me the syntax for this, that would be great.

Thanks Alot
 
Is Nothing is the way you test for an object's existence:

Set foundItem = itms.Find("[Subject] = ""Newmsgarray(i)""")
If foundItem Is Nothing Then
' do something
End If


--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Am 25 Jul 2006 01:58:12 -0700 schrieb vortex2k4:

Please try this one:

tms.Find ("[Subject] <> " & chr(34) & Newmsgarray(i) & chr(34))
 
Just for other people: I found a combination of both answers worked,
giving me this statement:

Set foundItem = itms.Find("[Subject] = " & Chr(34) & Newmsgarray(i) &
Chr(34))

If foundItem Is Nothing Then
'do something
End If


Thanks to both of you for your help :D

Lawrence
Is Nothing is the way you test for an object's existence:

Set foundItem = itms.Find("[Subject] = ""Newmsgarray(i)""")
If foundItem Is Nothing Then
' do something
End If


--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


vortex2k4 said:
Couldnt really find a definitive answer on this group so thought I
would start a new topic.

I want to be able to use the find command to find a subject that is in
a folder from an array.

So far I have this : itms.Find ("[Subject] = ""Newmsgarray(i)""")

It finds no errors but im not sure if it is working or not.

I want to be able to do something if the subject in the array is NOT
found rather that if it IS found.

If you could tell me the syntax for this, that would be great.

Thanks Alot
 
Back
Top