'PropertyAccessor error

I have an Outlook 2007 add-in made in Visual Basic with Visual Studio 2010. I developed this quite a long time ago and it has always worked fine. I detect embedded images using the attachment PropertyAccessor. I now have to go back and make some changes and am running into the following problem. Attempting get the property now gives me the following error (it never did before) The property "http://schemas.microsoft.com/mapi/proptag/0x37140003" is unknown or cannot be found. Other properties I can get fine. I have seen other posts with the same error which mention that the PR_ATTACHMENT_HIDDEN property is not set. I don't understand this as the attachment is an ordinary jpg sent by me from another account. If I build the add-in and install in Outlook 2016 it works just fine. What I find strange is that it used to work with no errors. I don't know if it makes any difference but it is running in VirtualBox.
Any Ideas would be welcome.



Solution 1:[1]

Keep in mind that PropertyAccessor.GetProperty behavior changed (in Outlook 2010?) when it comes to properties that are not present - GetProperty will now raise an exception instead of returning null.

You need to expect and handle that exception - no MAPI property should be expected to be present. In your particular case, missing PR_ATTACHMENT_HIDDEN is the same as PR_ATTACHMENT_HIDDEN == false.

Take a look at the available MAPI properties on the attachment in OutlookSpy (I am its author) - select the message, click IMessage button on the OutlookSpy ribbon, go to the GetAttachmentTable tab, double click on the attachment.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1