PDA

Click to See Complete Forum and Search --> : Filtering Emails in Outlook


rnlockyer
Nov 27th, 1999, 04:05 AM
************************
SubjectText = "Joke"

olFilter = "[Subject] = """ & SubjectText & """"

Set olMailMsgs = olInBox.Items

Set olMailMsg = olMailMsgs.Find(olFilter)

Do While olMailMsg Is Not Nothing
Debug.Print olMailMsg.Subject
Set olMailMg = olMailMsgs.FindNext
Loop

***************************

This will print the subject of each email in InBox that has the subject Joke. But I want to be able to find all emails with 'Joke' in the subject line (ie 'This is a good Joke' or 'Try these Jokes').

I guess I need to set SubjectText with some sort of wildcard character such as ...

SubjectText = "*Joke*"

But I cannot get this to work with Outlook's Items Find method.

Any suggestions?????? Thanks.

[This message has been edited by rnlockyer (edited 11-27-1999).]

[This message has been edited by rnlockyer (edited 11-27-1999).]