A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

If not found?



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old July 25th 06, 09:58 AM posted to microsoft.public.outlook.program_vba
vortex2k4
external usenet poster
 
Posts: 9
Default If not found?

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

Ads
  #2  
Old July 25th 06, 01:01 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default If not found?

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
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"vortex2k4" wrote in message oups.com...
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

  #3  
Old July 25th 06, 02:24 PM posted to microsoft.public.outlook.program_vba
Michael Bauer
external usenet poster
 
Posts: 435
Default If not found?

Am 25 Jul 2006 01:58:12 -0700 schrieb vortex2k4:

Please try this one:

tms.Find ("[Subject] " & chr(34) & Newmsgarray(i) & chr(34))

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.VBOffice.net --


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

  #4  
Old July 25th 06, 04:27 PM posted to microsoft.public.outlook.program_vba
vortex2k4
external usenet poster
 
Posts: 9
Default If not found?

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

Lawrence

Sue Mosher [MVP-Outlook] wrote:

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
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"vortex2k4" wrote in message oups.com...
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


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
One or more parameters could not be found Tim Outlook and VBA 3 June 20th 06 05:32 AM
No address book can be found ?? Bob Outlook - Installation 4 April 21st 06 07:16 PM
Contacts not found - they're one off! DickO Outlook - Using Contacts 3 January 30th 06 10:03 PM
Object can not be found naguaramipana Outlook - General Queries 3 January 30th 06 05:17 AM
Solution to this thread found skinnyladuk Outlook - General Queries 0 January 11th 06 11:52 PM


All times are GMT +1. The time now is 05:04 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.