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.

Download

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)
Scope
------------------------------------------------------------------------------------------------
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

Comments

Name
Comment
dtaylor - 2020-07-06
In further researching this issue, I have found something rather strange. The issue of being off by 1 hour is only for certain emails. These emails were sent to me from others using OneNote's "Email Page".

In other words, if someone emails me their notes from OneNote, this script will update the time and be off by 1 hour. It appears that other emails are not affected.
dtaylor - 2020-07-06
My time is off by 1 hour. This was supposed to be fixed on 10/31/2016, but I just downloaded and it's off for me. Maybe an update re-introduced the issue?
Mauricio Mello - 2019-06-13
I ran the command but it did not work, I'll send you an email with prints.