PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook VBA Programming Retrieve Message based on partial subject line match

Reply

Retrieve Message based on partial subject line match

 
Thread Tools Rate Thread
Old 15-02-2004, 02:56 AM   #1
=?Utf-8?B?RGF2aWQ=?=
Guest
 
Posts: n/a
Default Retrieve Message based on partial subject line match


How can I retrieve messages based on an partial match in the subject line
I am currently usin

Items.Restrict("[Subject] = """ & strSubject & """"

but this only works for extact matches. How can I base the retrieve on a partial match

Thank
David
  Reply With Quote
Old 16-02-2004, 03:41 PM   #2
Ken Slovak - [MVP - Outlook]
Guest
 
Posts: n/a
Default Re: Retrieve Message based on partial subject line match

You can use DAV syntax with the LIKE operator and the wildcard "%" and
the AdvancedSearch method to return a Search object with a Results
collection that can be iterated to harvest your returned messages.
That would work with Outlook 2002 or later.

You can set up an filter in the UI for the search you want and then
read the results in the SQL tab. To do that, open View, Current View,
Customize Current View and click on the Filter button. Define your
criteria in the Advanced or Query Builder tabs and then go to the SQL
tab to see how the filter look in DAV syntax. Then look at the Object
Browser Help for AdvancedSearch to see how to complete the search
string with folder and traversal settings.

If you don't see the Query Builder tab in that dialog you can create a
registry entry at HKCU\Software\Microsoft\Office\10.0\Outlook\ named
QueryBuilder. That is a new registry key and it doesn't have any
values, just creating that key is enough. Exit and restart Outlook to
use the new registry key.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginners Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"David" <anonymous@discussions.microsoft.com> wrote in message
news:68268810-5FC9-4FCC-96AC-B43F4CCBD33D@microsoft.com...
> How can I retrieve messages based on an partial match in the subject

line?
> I am currently using
>
> Items.Restrict("[Subject] = """ & strSubject & """")
>
> but this only works for extact matches. How can I base the retrieve

on a partial match?
>
> Thanks
> David



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

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