Outlook 2016 Searching based on CreationTime

Not open for further replies.


New Member
Outlook version
Outlook 2019 32-bit
Email Account
Exchange Server
I am using Outlook 2016 32-bit on a PC running Windows 10. I want to be able to search programmatically (i.e., VBA or VBS) for Contacts based on their CreationTime. I know that one particular Contact has a CreationTime of 20191101132354 (which is the YYYYMMDDHHMMSS value of when the Contact was created). How do I create a Restrict method to lookup Contacts based on their CreationTime?

When I try any of these attempts, they each fail:

"[CreationTime] = 20191101132354"
"[CreationTime] = '20191101132354'"
"[CreationTime] > 20190101000000 And "[CreationTime] <= 20191231235959"
"[CreationTime] > '20190101000000' And "[CreationTime] <= '20191231235959'"


Try formatting the dates in mm/dd/yyyy format - otherwise you need to use serial time. This macro will show you the format the dates are in -

Sub GetTime()
Dim objApp As Outlook.Application
Dim objItem As Object
Set objApp = Application
Set objItem = objApp.ActiveExplorer.Selection.Item(1)

Debug.Print objItem.CreationTime

End Sub

The Immediate window displays 8/6/2019 5:47:34 PM - so that is the format I need for exact matches - dates only should work for between, before, after searches.
Diane, did you mean to attach a macro? I don't see it.


There is a demo macro - so you can see the format of the creation date on your computer - that is the format you need to use. Here in the US is mm/dd/yyyy format by default, but may vary based on time and date formatting.
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
M Short term workaround for when Outlook searching stopped functioning Using Outlook 0
P How to add a column named categories when searching in Outlook Using Outlook 0
V vBA for searching a cell's contents in Outlook and retrieving the subject line Outlook VBA and Custom Forms 1
P Searching tasks that are archived Using Outlook 4
M Outlook 365 Searching all shared calendars Outlook VBA and Custom Forms 4
O Searching for Custom Flags Using Outlook 3
B Searching for a Add-In Using Outlook 3
J Searching message folder in Outlook 2016 Using Outlook 5
R Problem with searching public folders Exchange 2013/16 Exchange Server Administration 2
C Outlook 2016: Searching in all (+public) folders Outlook VBA and Custom Forms 9
Diane Poremsky Searching for Outlook Items in Windows Using Outlook 0
M Searching multiple folders Using Outlook 6
W Searching Flagged Email Outlook 2013 Using Outlook 1
E Searching a Shared Outlook Mailbox from the start menu? Using Outlook 4
Rijotech Fast searching from:name and date Using Outlook 3
S Searching contacts across GAL and local address book at same time Using Outlook 1
A Searching for text in Contact notes Using Outlook 2
M Searching for categories not in the master category list Using Outlook 3
P Searching By Contact Categories Using Outlook 0
B Searching OWA Additional Mailbox - in which Secondary folder is the email? Using Outlook 1
R searching a not function Using Outlook 2
R Searching emails sent/recieved on a specific date. Using Outlook 2
M Searching Outllook 2010 shared contacts from Outlook 2007 Using Outlook 4
G CTRL-E is not searching I-cloud contacts Using Outlook 2
M Jolly characters in Outlook 2007 searching Using Outlook 3
E Does Outlook 2010 support searching multiple .pst files simultaneously? Using Outlook 0
D searching Outlook 2010 Calendar Using Outlook 1
X outlook 2007 error when searching Using Outlook 7
T searching for attachments that have a certain "text" in the name Outlook VBA and Custom Forms 2
D Searching for Data in a custom form Outlook VBA and Custom Forms 1
P How to clear out all contacts in iCloud, so I can use iCloud-based sync program Using Outlook 1
R Advise on using multiple instances of network files based on customers Outlook VBA and Custom Forms 8
whizzard Change FROM address based on TO or CC address Outlook VBA and Custom Forms 8
D Forwarding email based on the attachment file type and specific text found on the attachment file name Outlook VBA and Custom Forms 1
W Macro to Filter Based on Latest Email Outlook VBA and Custom Forms 6
A Macro to file emails into subfolder based on subject line Outlook VBA and Custom Forms 1
J Implement Keywords based on body message Outlook VBA and Custom Forms 0
T Outlook Template - textbox visible based on combobox selection Using Outlook 1
E Having some trouble with a run-a-script rule (moving mail based on file type) Outlook VBA and Custom Forms 5
R Auto Assign Category colours to Incoming Emails based on whom the email is addressed Outlook VBA and Custom Forms 3
S Outlook Macro to move reply mail based on the key word in the subjectline Outlook VBA and Custom Forms 0
V Change start time based on message duration Outlook VBA and Custom Forms 2
A Move email items based on a list of email addresses Outlook VBA and Custom Forms 40
Andrew Quirl Custom form to route requests based on input criteria Outlook VBA and Custom Forms 1
K Conditional Formatting based on Department of person received from? Outlook VBA and Custom Forms 4
L Office 365 cloud based rules Using Outlook 1
mctabish Setting "Reply To" based on inbox Outlook VBA and Custom Forms 2
H Select Specific Account When Sending Email, Based on Current Folder Outlook VBA and Custom Forms 1
icacream Rule based on sender / wrong sender sent to folder Using Outlook 7
D Moving Emails Based on Recipient/Sender Outlook VBA and Custom Forms 4

Similar threads