Outlook 兑换:GetNamesFromIDs
我正在尝试从 Outlook 项目获取所有属性名称/值。 除了默认的 Outlook 项目属性之外,我还有自定义属性。 我正在使用赎回来绕过 Outlook 警告,但我在 Redemption.RDOMail 项目上的 GetNamesFromIDs 方法上遇到一些问题......
我正在使用我的赎回会话来获取消息并尝试使用该消息来获取所有属性的名称。
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
我不完全确定将什么作为第一个参数传递给 getNamesFromIDs。 GetNamesFromIDs 的定义如下:
GetNamesFromIDs(MAPIProp as Object, PropTag as Integer) As Redemption.NamedProperty
我不完全确定应该将什么作为 MAPIPProp 对象传入。 我没有看到文档中引用此属性。 http://www.dimastr.com/redemption/rdo/MAPIProp.htm# 任何帮助或见解将不胜
感激。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我想我明白了。 我只使用过VBA,所以你需要“思考”它的局限性,它将遵循VB.NET中相同的方案。
函数签名是这样的:
作为第一个参数,它需要一个支持
IUnknown
接口的对象。 查看 Redemption 文档,可以清楚地看到有一个名为_MAPIProp
的接口,许多其他 RDO 对象都是从该接口派生的(IRDOMail
就是其中之一)。 所以这一定是您试图从中获取数据的RDOMail
。知道这一点后,只需要文档中的另一个微妙提示即可使其正常工作:
所以属性标签必须是
>= 0x80000000
,这意味着它不适用于所有属性,而仅适用于自定义属性(我想这就是这种情况下的区别,如果我错了,请纠正我) .) 传入不满足此条件的属性标记会引发错误消息(0x8000ffff“意外结果”)。这是我的代码。 它是 VBA,所以请原谅我的 Hex() 错误,因为 VBA 的长整数对于那么大的数字会溢出。 我相信你会明白的。
输出的第一个片段:
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
IUnknown
interface. Looking at the Redemption docs it became clear that there is an interface named_MAPIProp
, from which many other RDO objects are derived (IRDOMail
is among them). So this must be the veryRDOMail
you 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:
好吧,对于背景信息,作者 建议 使用类似 OutlookSpy 查看 Outlook 如何存储属性。
查看 此交流(确保通读所有后续回复),没有更多了(事实上,我认为 Outlook MVP 在某一时刻键入
GetNamesFromIDs
当他的意思是GetIDsFromNames
)。您可能会尝试使用
GetIDsFromNames
查看返回的内容,然后使用它传递给GetNamesFromIDs
。我以前使用过救赎,但不是以这种特殊的方式,所以这就是我为你提供的一切......
Well, for background info, the author suggests using something like OutlookSpy to see how Outlook stores the properties.
Looking at this exchange (make sure to read through all the follow-up responses), there isn't much more (in fact, I think at one point the Outlook MVP types
GetNamesFromIDs
when he meansGetIDsFromNames
).What you might try is using
GetIDsFromNames
to see what that returns, and then use that to pass toGetNamesFromIDs
.I've used Redemption before, but not in this particular manner, so that's all I've got for you ...