Experts Exchange connects you with the people and services you need so you can get back to work.
Dim olFolder As Object
Dim filteredItems As Object
Dim folderItems As Object
Dim sorteditems As Object
Dim strFilter As String
Dim itm As Object
Set olFolder = Application.Session.GetDefaultFolder(olFolderInbox)
Set folderItems = olFolder.Items
strFilter = "@SQL=" & Chr(34) & "urn:schemas:httpmail:subject" & Chr(34) & " like " & "'%" & "corp" & "%'"
Set filteredItems = olFolder.Items.Restrict(strFilter)
If filteredItems.Count = 0 Then
MsgBox "No such tasks found"
For Each itm In filteredItems
Open in new window
Set myfolder = application.session.GetDefaultFolder(olFolderSentMail)
strfilter = "[SentOn] >= '" & Format(Date + TimeSerial(0, 0, 0), "ddddd h:nn AMPM") & "'" & " and " & "[senton] <= '" & Format(Date + TimeSerial(23, 59, 59), "ddddd h:nn AMPM") & "'"
Set olmailitems = myfolder.items.Restrict(strfilter)
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.