Outlook 2016 Searching based on CreationTime


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'"



Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
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 Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
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.
Thread starter Similar threads Forum Replies Date
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 New Slipstick.com Articles 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
M searching mail Exchange Server Administration 5
R Instant search is only searching Archive files, not all files Using Outlook 8
B Searching across public folders in EXCHANGE 2007 Exchange Server Administration 2
K about find mail or searching mail Using Outlook 2
L Searching and delegate mailboxes. Using Outlook 4
D I see two of every result when searching in Outlook 2010 Using Outlook 2
J Microsoft Outlook 2007 on Windows 7 search function stopped searching attachments - it use to search Using Outlook 1
C Outlook 2010 not searching very well Using Outlook 1
M Searching Archived Folders - Not finding sent items Using Outlook 1
K Searching Contacts after upgrade to 2010 Using Outlook 1
H Searching Public foldersin Outlook 2010 Using Outlook 2
P Searching Archived files in Outlook Using Outlook 1
B What or Where is the InfoBar?__Why is Help info so poor on providing/searching for info on the InfoB Using Outlook 2
X outlook 2007 error when searching Using Outlook 7
M Index not searching public folder contacts. Using Outlook 2
T Searching for numbers does not always work. Using Outlook 1
L Magnifying glass does not move when searching messages in Outlook 2010 and another related question Using Outlook 3
K Outlook 2007: Nothing happens when searching PST file Using Outlook 0
A problem searching GAL offline in Office 2007 Using Outlook 3
S "Microsoft Outlook 2010 has stopped working", then something about how it is searching for a solutio Using Outlook 2
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
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
Similar threads