I’m trying to get all property names / values from an Outlook item. I have custom properties in addition to the default outlook item properties. I’m using redemption to get around the Outlook warnings but I’m having some problems with the GetNamesFromIDs method on a Redemption.RDOMail Item….
I’m using my redemption session to get the message and trying to use the message to get the names of all the properties.
Dim rMessage as Redemption.RDOMail = _RDOSession.GetMessageFromID(EntryID, getPublicStoreID()) Dim propertyList As Redemption.PropList = someMessage.GetPropList(Nothing) For i As Integer = 1 To propertyList.Count + 1 Console.WriteLine(propertyList(i).ToString()) Console.WriteLine(someMessage.GetNamesFromIDs(________, propertyList(i))) Next
I’m not totally sure what to pass in as the first parameter to getNamesFromIDs. The definition of GetNamesFromIDs is as follows:
GetNamesFromIDs(MAPIProp as Object, PropTag as Integer) As Redemption.NamedProperty
I’m not totally sure what should be passed in as the MAPIProp object. I don’t see this property referenced in the documentation. http://www.dimastr.com/redemption/rdo/MAPIProp.htm#properties
Any help or insight would be greatly appreciated.
I think I figured it out. I have used VBA only, so you need to ‘think around’ it’s limitations, it will follow the same scheme in VB.NET.
The function signature is this:
As the first parameter it requires an object which supports the
IUnknowninterface. Looking at the Redemption docs it became clear that there is an interface named_MAPIProp, from which many other RDO objects are derived (IRDOMailis among them). So this must be the veryRDOMailyou are trying to get data out of.Knowing that, it needed only one other subtle hint from the docs to get it working:
So property tag must be
>= 0x80000000, this means it wont work for all properties, but just for the custom ones (I guess that is the distinction in this case, correct me if I’m wrong.) Passing in property tags not fulfilling this condition raises an error message (0x8000ffff ‘unexpected results’).Here is my code. It is VBA, so forgive me the Hex() blunder, as VBAs long integer overflows for numbers that big. I am sure you will get the picture.
First snippet from the output: