Update:
This issue was fixed in Redemption 5.2:
Previously, named MAPI properties in the "string" namespace specified in the DASL format ... always assumed to be of string type (PT_UNICODE or PT_STRING8).
It is now possible to explicitly specify the property type, e.g. PT_LONG (=3):
http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/MyIntegerUserProperty/0x00000003
I am using Redemption 5.1 (and Outlook 2010/64) and have run into this very annoying case:
When trying to write an object of byte[]
to a property it writes it as an PT_MV_LONG
property, not as PT_BINARY
.
This occurs when either using RDOProp.Fields
:
RDOItem rdoItem = GetRDOItem();
// note this is typed PT_BINARY
string dasl = "http://schemas.microsoft.com/mapi/string/{312FD430-D997-418A-8E1F-8D224FE69F5D}/MyProp/0x00000102";
byte[] data = GetSomeData();
rdoItem.Fields[dasl] = data;
...or when using RDOUtils.HrSetOneProp
:
// this also sets MyProp, but does so as PT_MV_LONG, not PT_BINARY
RDOUtils utils = CreateUtils();
var mapiObject = rdoItem.MAPIOBJECT;
var propTag = utils.GetIDsFromNames(mapiObject,
"{312FD430-D997-418A-8E1F-8D224FE69F5D}",
"MyProp");
utils.HrSetOneProp(mapiObject, propTag, encoded);
The above code does not compile, but the types are correct.
Update:
With the string property the way it is above, Redemption is creating the property "MyProp/0x00000102", and not "MyProp".