Article ID: 182453
Article Last Modified on 11/23/2006
' Set the MyFldr object to the default Inbox.
Set MyFldr = Item.Application.GetNameSpace("MAPI").GetDefaultFolder(6)
' MyVar is the subject of the mail message to search for.
' Change this to match a mail message in your Inbox.
MyVar = "Please read!"
' This is the standard approach without using a variable.
Set Itm = MyFldr.Items.Find("[Subject] = ""Please read!""")
' This approach uses Chr(34) to represent a quotation mark.
Set Itm = MyFldr.Items.Find("[Subject] = " & Chr(34) & MyVar & Chr(34))
' This approach uses double quotation marks to represent a
' quotation mark.
Set Itm = MyFldr.Items.Find("[Subject] = """ & MyVar & """")
' Display the date/time the found mail message was created.
MsgBox Itm.CreationTime
Additional query words: OutSol OutSol98
Keywords: kbdtacode kbhowto kbprogramming KB182453