有没有办法在给定 entryid(或 storeid)的情况下获取 mapifolder 或 Outlook 互操作文件夹的 smtpaddress [英] is there a way to get the smtpaddress for an mapifolder or outlook interop folder given the entryid (or storeid)

查看:64
本文介绍了有没有办法在给定 entryid(或 storeid)的情况下获取 mapifolder 或 Outlook 互操作文件夹的 smtpaddress的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我有通过文件夹选择器从 Outlook 互操作库中选择的 mapifolder 的 storeid,有没有办法让我获得该文件夹的 smtpaddress?

if i have the storeid for a mapifolder, selected through the folderpicker from the outlook interop libraries, is there a way for me to get the smtpaddress for that folder?

我知道它在扩展属性中,但我希望在没有任何繁重解析或 ldap 查询的情况下做到这一点.

i know it's in the extended properties, but i was hoping to do it without any heavy parsing or ldap querying.

我需要 smtpaddress 的原因是为了通过 EWS 连接到文件夹 - 我目前正在尝试用交换 Web 服务替换我们对 Outlook 互操作的引用,这已经成为一个症结,因为我们的许多用户拥有对不属于他们的邮箱的委托访问权限

the reason i need the smtpaddress is in order to connect to the folder via EWS - i'm currently trying to replace our references to outlook interop with exchange web services, and this has become a sticking point, since many of our users have delegate access to mailboxes that don't belong to them

推荐答案

对于邮箱所有者,您可以尝试读取 MAPIFolder.Store 属性以获取父存储,然后读取 PR_MAILBOX_OWNER_ENTRYID 属性(DASL 名称 "http://schemas.microsoft.com/mapi/proptag/0x661B0102") 使用 Store.PropertyAccessor.GetProperty.然后,您可以使用商店所有者条目 ID 调用 Namespace.GetAddressEntryFromID.拥有 AddressEntry 对象后,您可以使用 AddressEntry.GetExchangeUser.PrimarySmtpAddress.

For the mailbox owner, you can either try to read the MAPIFolder.Store property to get to the parent store, then read the PR_MAILBOX_OWNER_ENTRYID property (DASL name "http://schemas.microsoft.com/mapi/proptag/0x661B0102") using Store.PropertyAccessor.GetProperty. You can then use the store owner entry id to call Namespace.GetAddressEntryFromID. Once you have the AddressEntry object, you can use AddressEntry.GetExchangeUser.PrimarySmtpAddress.

请注意,PR_MAILBOX_OWNER_ENTRYID 属性仅在在线商店中可用.您可能想要使用 Redemption 及其 RDOExchangeMailboxStore.Owner.SmtpAddress 属性.可以使用 RDOSession.GetRDOObjectfromOutlookObject(Store) 或使用 RDOSession.GetStoreFromID 检索 RDOExchangeMailboxStore.

Note that PR_MAILBOX_OWNER_ENTRYID property is only available in the online stores. You might want to use Redemption and its RDOExchangeMailboxStore.Owner.SmtpAddress property. RDOExchangeMailboxStore can be retrieved using RDOSession.GetRDOObjectfromOutlookObject(Store) or using RDOSession.GetStoreFromID.

这篇关于有没有办法在给定 entryid(或 storeid)的情况下获取 mapifolder 或 Outlook 互操作文件夹的 smtpaddress的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆