View Single Post
  #3  
Old June 10th 08, 03:02 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Find messages in multiple inbo for Outlook 2003

Answered at http://www.outlookcode.com/threads.a...essageid=26940

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Andrey_R" wrote in message news
Hi! I receive massages in multiple inbox whith different address. I need
check this massages simultaneously. This code correctly work whith inbox
single address. What must I modify?

Public WithEvents srchResults As Outlook.Results
Public srch As Outlook.Search
Dim sFromCondition As String
Dim sCondition As String

sFromCondition = "(NOT urn:schemas:httpmail:from like '%" +
GetEntryAddress(anApplication.Session.CurrentUser. AddressEntry) + "%') AND "
+ "(urn:schemas:httpmail:subject LIKE '%" +
AA_Actions_StrReceive + "%')"
sCondition = sFromCondition
Set srch = anApplication.AdvancedSearch("'//" +
anApplication.Session.GetDefaultFolder(olFolderInb ox).Parent.Name + "'", _
sCondition, True)
If Len(sLastStartCondition) 0 Then sCondition = sLastStartCondition + "
AND " + sFromCondition

Set srchResults = srch.Results

Ads