Consulting

Results 1 to 2 of 2

Thread: Moving to a folder and executing search parameters

  1. #1

    Moving to a folder and executing search parameters

    I need to do the following. Move to a folder, search that folder for any message that was recieved today and has the text "Todays meeting".

    Assume that I have the folders name stored in a string, I have the text I'm searching for saved as a string, and the date I'm searching for also stored in a string.

    How would I go about doing this?

    Many Thanks,
    Farrell

  2. #2
    Good Evening.

    Try this:

    [vba]
    Public Sub Find_Messages()
    Const strSubFolder = "Saved"
    Const strSearchString = "Today's Meeting"

    Dim folInbox As MAPIFolder
    Dim folSaved As MAPIFolder
    Dim olmMessage As MailItem
    Set folInbox = Session.GetDefaultFolder(olFolderInbox)
    Set folSaved = folInbox.Folders.Item(strSubFolder)
    Set olmMessage = folSaved.Items.Find(strSearchString)
    Do Until olmMessage Is Nothing
    ' Process Message here.

    folSaved.Items.FindNext
    Loop
    End Sub
    [/vba]

    Scott
    You don't understand anything until you learn it more than one way. ~Marvin Minsky

    I never teach my pupils; I only attempt to provide the conditions in which they can learn. - Albert Einstein

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •