Advanced Search in MS Outlook by VBA and SQL

Status
Not open for further replies.

Bamerand

Member
Outlook version
Outlook 2013 32 bit
Email Account
Exchange Server
Here is a code I was able to modify to meet my expection (got from www.slipstick.com). It loops thru entire Outlook and find (in different PST) emails received / sent within today. So far so good. Now, it also searches for and finds Outlook items such new contacts in "Recipient Cache", "Tasks", "Calendar" and "Sync Issues". Is there a way to add a line that will allow to skip the above mentioned "Recipient Cache", "Tasks", "Calendar" and "Sync Issues"? Filtering does not do good as the filter enableed search process slowes down the PC by almost 10 times, for with no filter applied the search takes no more that 15 seconds in total, meanwhile enabling filter in views makes the search more than 2.5-3 minutes. I am open to any suggestions.

Sub SentToday()
Dim myolApp As New Outlook.Application
Dim tDate As Date
On Error GoTo ErrHandler
tDate = Date 'Today
txtSearch = "sent: (=" & tDate & ")"
myolApp.ActiveExplorer.Search txtSearch, olSearchScopeAllOutlookItems
Set myolApp = Nothing
Exit Sub
ErrHandler:
MsgBox "Oops, an error has occured." & vbCrLf & vbCrLf & "Error Code : " & Err.Number & " , " & Err.Description
Call GoToMyInbox
End Sub
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
R Outlook for Mac - Advanced Search and Tracking Sent Emails Using Outlook 0
A Outlook 2003 / Advanced Find, how to set for search all subfolders ??? Using Outlook 3
A Outlook Advanced Search Problems...returns with an Error: Argument Outlook VBA and Custom Forms 1
T Outlook 2007 Indexing Options and Advanced Search options disabled Using Outlook 5
D Advanced Search Question Using Outlook 1
B Printing Advanced Search Output Screen Using Outlook 5
R No indication that Advanced Find is working under Search Tools. Using Outlook 2
P Open Advanced Search Dialog Outlook VBA and Custom Forms 1
M Sorting by Day in Date Column Advanced Filter BCM (Business Contact Manager) 1
L unblocking attachments before sending Office 365 Advanced Protection Using Outlook 0
N Disable Auto Read Receipts sent after using Advanced Find Using Outlook 4
H "Advanced find: column for full folder path? Using Outlook 1
skylark53 Advanced recurrence problem Using Outlook 2
Andrew Hawkins "Advanced Find" Using Outlook 1
A Advanced find query facilty Help please Using Outlook 2
P Outlook Advanced Find Using Outlook 0
S Advanced Find text field limits Using Outlook 2
C O2010: Using Advanced Find to locate exact queries Using Outlook 3
V Advanced Find - [Today]-3 ? Using Outlook 4
N Outlook 2010 crippled Advanced Find, now what? Using Outlook 3
H Outlook 2010 Advanced Find - Menu items missing Using Outlook 1
D Outlook 2010 - Advanced Find - No Status Bar = No Item Count Using Outlook 2
J How to filter by address fragment (e.g. "@domain.com") with advanced find? Using Outlook 2
N WINDOWNS LIVE SETTINGS / ADVANCED / REPLY E-MAIL (does not reply to email selected) Using Outlook 3
O Desktop Advanced Find Cannot Find Messages Sent via Blackberry - but they are synched and listed in Sent Folder Using Outlook 2
M Outlook 2010 and the add-in Advanced Folder Watch Using Outlook 2
L SIGNATURE Advanced Edit Editor Using Outlook 5
D Need to export contacts but the export/import option does not show in the advanced options tab as the HELP option says it will Using Outlook 4
C Outlook 2010 E-mail Signature Advanced edit Using Outlook 2
J Can't print memo style from advanced find in Outlook 2007 Using Outlook 2
L How to customize the Advanced Find form Outlook VBA and Custom Forms 1
D Re: How to customize the Advanced Find form Outlook VBA and Custom Forms 1
J Advanced outlook trick: help needed! Outlook VBA and Custom Forms 3
S Programmatically bring up Advanced Find for contacts? Outlook VBA and Custom Forms 1
P outlook 2008 search box criteria couldn't be saved Using Outlook 2
C Outlook with Office365 - search across account, by date rate, in multiple folders - how? Using Outlook 1
D Custom Search Folders not refreshing/updating automatically Using Outlook 0
L New Location for the Search Bar Using Outlook 6
T How can you include Junk Email in Search Results like you can include Deleted Items? Using Outlook 3
J Outlook 2016 After a search in all mailboxes, where is each message that was found? Using Outlook 6
King Mustard Sort search groups by amount of items? Using Outlook 1
V Outlook 2016 will not move emails in search results Using Outlook 4
T Search for incoming e-mails for a specified time range Using Outlook 1
S outlook 2007 calendar search Using Outlook 6
M Outlook macro to automate search and forward process Outlook VBA and Custom Forms 6
J Message search and edit, another way? Outlook VBA and Custom Forms 4
S Create A Search Folder That Looks For Message Class? Outlook VBA and Custom Forms 0
R Search/Jump to a folder by typing its name Outlook VBA and Custom Forms 1
M Sent mail not showing in Sent Items folder; but they can be found with Search Using Outlook 3
A Outlook 2019 having issues with 'people search' and not making suggestions in email To: etc Using Outlook 12

Similar threads

Top