Asked by:
Documentation for Outlook specific attachment types?

Question
-
(Sorry in advance if this question is in the wrong forum. I honestly Can't think of where else if would go.)
I'm a developer working on a Python project called "msg extractor" that is able to open and understand a good portion of the .msg file format, the format the Outlook saves messages in. While trying to expand it's capabilities, I came across a specific type of attachment only noted in the documentation I could find as being in "Application specific format". While I can't reasonably add support for formats from every singly email program, I would like to be able to add support for any attachments that Outlook might create. As such, I was wondering if documentation on the types of attachments Outlook creates has been published anywhere?
Thank you for your time.
Sunday, August 2, 2020 10:58 PM
All replies
-
Hello,
The OlAttachmentType enumeration provides all attachments types in Outlook. An additional item which is not listed there is linked files uploaded to any web server storage such as OneDrive. The Attachment type for a linked file is a value of 7. Using the usual method of .Attachments.Add you can specify the type to be 7 and that attaches the file as a link rather than a copy of the online file. This should work whether it is a Onedrive/Sharepoint/Teams file.
OutlookItem.Attachments.Add *FileFullOnlinePath*, 7
Monday, August 3, 2020 9:59 AM -
I assume that "Application specific format" is referring to the afStorage flag documented at MS-OXCMSG 2.2.2.9 PidTagAttachMethod Property. This documentation refers to MS-OXCMSG 2.2.2.8 PidTagAttachDataObject Property which mentions the binary representation of an attachment object.
However, in the context of a .MSG file and its format the afStorage flag is disussed at MS-OXMSG 2.2.2 Attachment Object Storage which explains "If the Attachment object has a value of afStorage (0x00000006) for the PidTagAttachMethod property ([MS-OXCMSG] section 2.2.2.9), then there is a custom attachment storage under the Attachment object storage."
This custom storage relates to the way that data is stored in the .MSG file, not to the attachment data. Refer to MS-OXMSG 2.2.2.2 Custom Attachment Storage for the explanation for this item.
I don't believe that Outlook would create a .MSG file using a custom storage, but I have not attempted to verify this.
- Edited by RLWA32 Monday, August 3, 2020 10:26 AM
Monday, August 3, 2020 10:22 AM -
When I say "Application specific storage, I mean afStorage (0x00000006). Also, I am not looking for how to add attachments to a file in outlook. Instead, I am looking for documentation about outlook's use of afStorage that is not mentioned in the regular msg documentations.Monday, August 3, 2020 2:00 PM
-
I assume that "Application specific format" is referring to the afStorage flag documented at MS-OXCMSG 2.2.2.9 PidTagAttachMethod Property. This documentation refers to MS-OXCMSG 2.2.2.8 PidTagAttachDataObject Property which mentions the binary representation of an attachment object.
However, in the context of a .MSG file and its format the afStorage flag is disussed at MS-OXMSG 2.2.2 Attachment Object Storage which explains "If the Attachment object has a value of afStorage (0x00000006) for the PidTagAttachMethod property ([MS-OXCMSG] section 2.2.2.9), then there is a custom attachment storage under the Attachment object storage."
This custom storage relates to the way that data is stored in the .MSG file, not to the attachment data. Refer to MS-OXMSG 2.2.2.2 Custom Attachment Storage for the explanation for this item.
Everything you say is correct until the last statement. This custom storage DOES relate to the way the specific attachment has been stored as data inside the file and not anything else. The Documentaion also mentions that an example of what it means for PidTagAttachMethod to be afStorage is in [MS-OSMSG] section 3.3. The section is as follows:
Also, unless the email servers these messages go through are being completely modified by the email servers they go through then the attachments MUST be being generated this way by outlook. The emails I am looking at the data for were made, sent, received, and saved all by Outlook. I don't know exactly why, but having an image inside of your signature seems to cause Outlook to do this. So far, that is the only thing I have found that these emails have in common.
Monday, August 3, 2020 2:10 PM -
This custom storage relates to the way that data is stored in the .MSG file, not to the attachment data. Refer to MS-OXMSG 2.2.2.2 Custom Attachment Storage for the explanation for this item.
Everything you say is correct until the last statement. This custom storage DOES relate to the way the specific attachment has been stored as data inside the file and not anything else.
I'm not quite sure why you take exception. I'm talking about the format of the storage in a .msg file, not the content of those storages/streams.
Monday, August 3, 2020 2:21 PM -
I think I misunderstood what you meant. You meant that it is the format the data specifically in the __attach_version1.0_#00000000, __attach_version1.0_#00000001, etc. folders (not their sub-folders), correct? If that is the case, I misinterpreted it as meaning how data for the ENTIRE msg file was stored.Monday, August 3, 2020 2:25 PM
-
I think we're on the same page. The attachment object storage's "__substg1.0_3701000D" sub-storage provides for the application specific data format for its content (i.e., the way that the data is stored).Monday, August 3, 2020 2:40 PM
-
Okay, now that that misunderstanding is cleared up we can just ignore what I said on that point.
However, the rest of my points still stand.
Monday, August 3, 2020 2:42 PM -
It seems that what you are looking for are Outlook implementation details. Those may be hard to come by since it is highly doubtful that they are documented by MS.Monday, August 3, 2020 2:48 PM