Hello
There’s a problem reading OLE2 messages/storages causing some headers to return null/empty values.
A ready to run project with a sample OST is attached to see the effect, using v22.9 with recent bug fixes applied.
Run and check all the ComboBox items to se they exist in any folder!
From/To/CC/BCC fields are affected, plus I found incorrect Date.Min for some messages’ date field (reported in a separate thread)
Please consider this description:
OLE2 format saves sender and recipients in two places: Internet headers and separate properties. Usually, they match. Sometimes, they don’t.
Condition 1 :: If the OLE2 message/storage doesn’t have Internet headers at all (i.e. it’s a draft which has never been sent), it won’t have Internet headers anyway and From/To/CC/BCC MUST be obtained from their designated properties only.
Condition 2 :: If the .MSG message does have Internet headers but doesn’t have From/To/CC/BCC in separate properties, only values from Internet headers MUST be used.
Condition 3 :: If both exist and are different for each field (From/To/CC/BCC) should take the proper decision for each one, I’ve no idea on choose which one or add a property for use to choose.
(if this happens, must be effective only when both exists and are different, to specify prefer which one.
BUG :: You are ONLY reading From/To/CC/BCC from separate properties, and not from Internet headers, not only for this OST file, for all the OLE2 Outlook based messages like MSG.
I think should consider this to assign the following fields from Internet headers if their properties are null / empty:
MessageInfo.SenderRepresentativeName
MessageInfo.DisplayTo
MessageInfo.DisplayCC
MessageInfo.DisplayBCC << W8, does not exists, hope it can be added
WindowsApplication1.zip (9.9 MB)