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

Items.Find - To - With mutliple e-mails



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old November 4th 09, 11:11 PM posted to microsoft.public.outlook.program_vba
GregR
external usenet poster
 
Posts: 1
Default Items.Find - To - With mutliple e-mails

I'm trying to do a find against a folder, on the "to" field, against a bunch
of e-mails. If the "To" has one e-mail, it works fine. If it has more than
one (e.g., ; ; ) it doesn't work.

Example:


_MailItem mailItemTest = oItems.Find("[To] = '") as _MailItem;

(The above oItems points to a valid folder).

So with this example, any messages in the folder that have a single "to" of
" will return the first found (and FindNext the next). If any
of the messages in the folder contain " and any other e-mails
in the to, that message is not returned.

I'm trying to find all e-mails with a "to" of a specific address - but most
will have that one plus others.

Any ideas here? I tried wild carding it, without luck. I've written code
to iterate through and do my own search, but the folder can have a lot of
e-mails, so that is very slow and I quickly run into the outlook connect
limit.

Thanks,
-Greg
Ads
  #2  
Old November 5th 09, 03:19 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Items.Find - To - With mutliple e-mails

Outlook version? Even if this isn't for Outlook 2007 where you can use the
new content searching you can use SQL syntax in a Find/Restrict by prefacing
the SQL search with "@SQL=".

In that case you use the DASL property tag, so it would be
"http://schemas.microsoft.com/mapi/proptag/0x0E04001E" or
"urn:schemas:httpmail:displayto". The filter would look something like this:

string filter = "@SQL=" + "\"" + "urn:schemas:httpmail:displayto" + "\"" + "
LIKE %' ";

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"GregR" wrote in message
...
I'm trying to do a find against a folder, on the "to" field, against a
bunch
of e-mails. If the "To" has one e-mail, it works fine. If it has more
than
one (e.g., ; ; ) it doesn't
work.

Example:


_MailItem mailItemTest = oItems.Find("[To] = '") as
_MailItem;

(The above oItems points to a valid folder).

So with this example, any messages in the folder that have a single "to"
of
" will return the first found (and FindNext the next). If
any
of the messages in the folder contain " and any other
e-mails
in the to, that message is not returned.

I'm trying to find all e-mails with a "to" of a specific address - but
most
will have that one plus others.

Any ideas here? I tried wild carding it, without luck. I've written code
to iterate through and do my own search, but the folder can have a lot of
e-mails, so that is very slow and I quickly run into the outlook connect
limit.

Thanks,
-Greg


 




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
Sent mails are there in sent items [email protected] Outlook - Calandaring 1 September 19th 07 01:22 PM
Mails not appearing in Sent Items Sean Outlook - General Queries 1 November 1st 06 02:23 PM
Reading mails from Sent items, Deleted items, Draft folder of outlook from VB6.0 Viswanathan Outlook - General Queries 8 May 26th 06 04:31 PM
Still Can't Find My Old E-mails... Juan Enriquez Outlook - Installation 2 April 7th 06 08:03 AM
2003 calendar's find, doesn't find items created today till tomarr Support7556 Outlook - Calandaring 11 January 20th 06 09:54 PM


All times are GMT +1. The time now is 03:40 PM.


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.