I need to create an OutLook add-in that catches emails with large attachments and replaces the attachment with a URL that can be used to download the attachment.
I found this which shows how to modify an attachment before sending it that looked like a good starting point but the problem is that the call:
const string PR_ATTACH_DATA_BIN = "http://schemas.microsoft.com/mapi/proptag/0x37010102";
var attachmentData = attachment.PropertyAccessor.GetProperty( PR_ATTACH_DATA_BIN);
fails with an error saying the property is unknown or cannot be found.
I can call attachment.PropertyAccessor.GetProperty() to get the attachment type which is 1 (ATTACH_BY_VALUE) so I should be able to get the data with attachment.PropertyAccessor.GetProperty(PR_ATTACH_DATA_BIN)
I am wondering if there is a privilege problem here. I see here: dev.office.com/docs/add-ins/outlook/understanding-outlook-add-in-permissions that there are Outlook add-in permissions and that if I did not ReadWriteItem access then this could fail. I do not know how or where this is set though. They mention about it being set in the manifest but I do not see where I can do that.
I am using Visual Studio Community 2015.