Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search for mail in PST based on subject

Status
Not open for further replies.

DanMIS

MIS
Sep 16, 2004
189
US
I have to search through PST files looking for mail that has certain words in the subject line. There are several possibilities that the subject may contain. Currently they only want the mail that has that text in the subject line.

I cannot get my outlook 2007 to properly search based on the subject line. Anyone know of a utility to use?

Thanks,
Dan

CCA Citrix 4.0
MCSA: Messaging 2003
MCSE 2003
 
Hi Dan,

yepp, this is one issue I am fighting with, too.
Hope anyone has some good advice for this.

In case this gives an idea to you or any other one, this is what I tried (but not succeeded with yet):
This is what I've got so far:
Code:
Dim pst As MAPIFolder, fol As MAPIFolder
Dim objSch As Search
Dim strF As String
Dim strS As String
Const strTag As String = "SubjectSearch"

strF = "urn:schemas:mailheader:subject = '" & UserForm1.TextBox1.Text & "'"

For Each pst In Outlook.Session.Folders
    For Each fol In pst.Folders
        If fol.DefaultItemType = olMailItem Then
            strS = strS & fol.Name & ", "
        End If
    Next fol
    If Len(strS) > 0 Then
        'Outlook.Session.PickFolder***this was one futile attempt
        strS = Left(strS, Len(strS) - 2)
        Set objSch = pst.Application.AdvancedSearch(Scope:=strS, Filter:=strF, SearchSubFolders:=True, Tag:=strTag)
    End If
    strS = ""
Next pst

Curious greetings,
MiS

[blue]Help us, join us, participate
IAHRA - International Alliance of Human Rights Advocates[/blue]
 
I don't run 2k7, so this may not apply ...

1. Create a rule to assign msgs with those keywords to a category.
2. Apply the rule to all messages in target msg folders.
3. Add category to the view and sort by it.

Bit of a kludge to overcome a sorely deficient search facility in Outlook.

Jock
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top