Outlook Email Date Stamp

Description : This macro will change the creation date of each page in the current section with the time the email was sent, allowing them to be sorted by the email date. This has been made specifically for emails sent to OneNote from Outlook.


Author(s) : Omer Atay, JasonDaSilva
Category : EMail
Last Updated : February 11, 2018
Requirements : OneNote 2010 or above
Screenshot :

Outlook Email Date Stamp

This Macro will change the page creation date to match the Sent date on the email. This will then allow you to use the Sort by Date macro regardless of when you moved the mail message to OneNote. Email sent date is in a row in the table. The first column says 'Sent' in English, change that based on your language below. The second column has the date, provide the format for the date. This looks something like: ┌──────┬──────────────────────────────────┐ │ Sent │ Friday, February 9, 2018 7:05 PM │ └──────┴──────────────────────────────────┘ Legend for Date Format (examples use values from the date above) Y: 4 digit year (2018) M: 2 digit month (02) D: 2 digit day (09) y: 2 digit year (18) m: 1 or 2 digit month (2) d: 1 or 2 digit day (9) H: 2 digit hour (07) T: 2 digit minute (05) W: Day of the week (Friday) h: 1 or 2 digit hour (7) t: 1 or 2 digit minute (5) N: Month name (February) A: AM or PM (PM) ?: Any 1 character (Useful for things like ?? for -th, -st, -nd, -rd suffixes) For month and day names list short names below if that is the case (Jan,Feb,Mar,...) Also use any other character directly as it appears like comma (,) or space ( ) To get 'Friday, February 9, 2018 7:05 PM', you would need 'W, N d, Y h:T A' as the date format
First column value ('Sent' in English)
Date Format (Use legend above)
Separate values below with comma
Month names (Use short names if they appear as such on the page)
Day names starting Sunday (Use short names if they appear as such on the page)
AM and PM values if applicable
Changelog :

February 11, 2018 (89E413) - Omer Atay
Allow user to specify format for e-mail date/time so that it can be used to read pages that have date/time in different formats or languages

January 18, 2017 (D8A645) - JasonDaSilva

October 31, 2016 (1B2707) - Omer Atay
Fixed issues with time being off by 1 hour. It will detect timezone automatically and will no longer ask for it.

June 19, 2016 (83DA32) - JasonDaSilva
Automatically upgraded to the new Macro Language

These versions are no longer supported:

November 27, 2014 - JasonDaSilva
Add user prompt for timezone

October 14, 2014 - JasonDaSilva
Initial version


Mauricio Mello - 2019-06-13
I ran the command but it did not work, I'll send you an email with prints.
Mauricio Mello - 2019-06-13
In Brazil date format, there are two "de", one after the day and the other before the year.
How to put "de" twice?

Omer Atay - 2019-06-12
Mauricio Mello: Sounds like you want something like: W, d ?? N ?? Y h:T
Remove : after ?? and probably you need the second ?? (I am guessing this is for "de" before and after the month name. Also you have a space after h: remove that space. If you can't figure out, email support@getonetastic.com