[COLOR=green]
'''''''''''''''''''''''''''''''''''''''''''''''
'' Ol2k, Acc2k
'' Find message in Ol 'Sent Items' folder
'' matching spec criteria
''
''' Create OL button:
'''
''' 1. View>Toolbars>Customize...>Toolbars>New
''' 2. Enter a name for toolbar
''' 3. Click "Commands" tab
''' 4. Select "Macros" in "Categories"
''' 5. Drag "Project1.FindSentMail onto button
''' 6. Optional: Modify Selection
''
'''''''''''''''''''''''''''''''''''''''''''''''
[/color green]
Sub FindSentMail()
On Error GoTo Err_FindSentMail
Dim molApp As Outlook.Application, _
molNamespace As Outlook.NameSpace, _
molMAPI As Outlook.MAPIFolder, _
molItem As Outlook.MailItem
Set molApp = CreateObject("Outlook.Application")
Set molNamespace = Application.GetNamespace("MAPI")
Set molMAPI = molNamespace.GetDefaultFolder(5) '(olFolderSentMail)
For Each molItem In molMAPI.Items
[COLOR=green]'' Criteria:[/color green]
If InStr(molItem.To, "YourRecipientHere") > 0 _
And molItem.SentOn = Date _
And InStr(molItem.Subject, "YourSubjectHere") > 0 Then
[COLOR=green]
'' Test in Immediate window:[/color green]
Debug.Print molItem.To, molItem.SentOn, molItem.Subject
[b][COLOR=green]
'' If 'FindSentMail' works properly you could
'' insert your next procedure call here.
[/color green][/b]
End If
Next molItem
Exit_FindSentMail:
Set molMAPI = Nothing
Set molNamespace = Nothing
Set molApp = Nothing
Exit Sub
Err_FindSentMail:
Debug.Print Err.Number, Err.Description
Resume Next
End Sub