0
votes

I have a Office Outlook Addin. I have created for 2010 however it is supported on office 2007, 2010 and 2013. We ran a test on a Office 2007 machine and received:

Object does not support property "http://schemas.microsoft.com/mapi/proptag/0x37010102"

I am accessing an MailItem attachement. I get the PropertyAccessor for the attachment and call the GetProperty Method:

const string PR_ATTACH_DATA_BIN = @"http://schemas.microsoft.com/mapi/proptag/0x37010102";
PropertyAccessor propertyAccessor = attachment.PropertyAccessor;
var PR_ATTACH_DATA_BIN_Value = propertyAccessor.GetProperty(PR_ATTACH_DATA_BIN);

I can access the attachment type which indicates the data should be found in the property above. Attachement method is ATTACH_BY_VALUE.

Is there something I'm overlooking as it works on all the other machines running office 2010 and 2013?

1

1 Answers

0
votes

The GetProperty method of the PropertyAccessor class can't be used for large property values (more than 8K bytes). In Outlook 2007 unfortunately there's a limitation on PropertyAccessor in retrieving properties that are larger than about 8KB.

What happens at a MAPI level is PropertyAccessor is using a MAPI HrGetOneProp call. That will fail on data over about 8K and then you fall back to getting the property as an IStream. In 2007 Outlook doesn't do that with PropertyAccessor due to performance reasons and because of the cost of implementing that functionality. So with PropertyAccessor in 2007 you can write larger properties but not read them back.

In Outlook 2010 that is fixed and you can read the attachment content even for very large attachments. You need to use the OpenProperty method (Extended MAPI) and the IStream interface to bridge the gap. Also you may consider using third-party wrappers around Extended MAPI (redemption).