0

This question refers to the code posted in my previous question.

That routine outputs property data for the e-mails in an Outlook folder. It gets the data either directly from the MailItem object (sLoopThru = "folder") or from a table object built from the folder (sLoopThru = "table"). In the output of that routine, I get the following differences depending on which method is used:

  • For most of the e-mails in the tested folder, the size reported by oTableRow("Size") is 16 bytes less than that reported by oEmailItem.Size.
  • When a time value accessed from the table is null, such as a few of oTableRow("SentOn") and all of oTableRow("ReminderTime"), the value reported by the property directly, such as oEmailItem.SentOn and oEmailItem.ReminderTime, is 949998, which Excel automatically formats as the strange date, 4501 01 01.

The size issue is the most concerning because it's a discrepancy in the size reported for some but not all e-mails. The timestamp issue is just weird.

What is the cause of the size discrepancy and since when is the first day of the year 4501 equivalent to a null date?

NewSites
  • 1,402
  • 2
  • 11
  • 26

1 Answers1

1

1/1/4501 is a special date in OOM meaning there is no data, since you cannot return null from a DateTime property (it is scalar).

How size is reported is up to the provider - it is the size of all properties plus whatever is necessary to store those properties.

Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78
  • Are those two facts documented anywhere, whether on your site or elsewhere? I searched for the date and didn't find any documentation of it. – NewSites May 24 '23 at 18:49
  • 1
    The first one is well known: https://www.google.com/search?q=1%2F1%2F4501+site%3Amicrosoft.com&client=firefox-b-1-d&sxsrf=APwXEdeJkn9Yg-iDRd_JM3wQmgfsp1iHnQ%3A1684956659809&ei=82VuZKSFMd-kqtsPt6eGuAg&ved=0ahUKEwjkyq3Z2I7_AhVfkmoFHbeTAYcQ4dUDCA8&uact=5&oq=1%2F1%2F4501+site%3Amicrosoft.com&gs_lcp=Cgxnd3Mtd2l6LXNlcnAQAzoHCAAQHhCwAzoLCAAQCBAeEA8QsAM6BAgAEB46BQghEKABOgUIIRCrAjoICCEQFhAeEB06CgghEBYQHhAPEB1KBAhBGAFQowNYqA9gtBFoAXAAeACAAZcCiAGBC5IBBTAuNS4ymAEAoAEBoAECyAECwAEB&sclient=gws-wiz-serp#ip=1 – Dmitry Streblechenko May 24 '23 at 19:31
  • The second one... I don't know if it is documented, it is just the way it is. – Dmitry Streblechenko May 24 '23 at 19:32
  • 1
    Well known by people who know it. Interesting that from that Google link, I find one link to the Outlook documentation, and it's for the `MarkAsTask` method *. Nothing about being used in `SentOn`, etc. But anyway, at least it is documented there that 4501 01 01 means null. So thank you. * https://learn.microsoft.com/en-us/office/vba/api/outlook.olmarkinterval – NewSites May 24 '23 at 20:17