在 Delphi XE 应用程序中显示 Outlook 通讯簿:
我有一个 Delphi XE 应用程序,我想弹出 Outlook 在我的 Delphi 应用程序中使用的通讯簿对话框 - 我假设有 COM 类支持此操作?完成这件事的最佳方法是什么?平台是 Win7-64,带有 Outlook
2010。TIA
I have a Delphi XE app and I'd like to pop up the address book dialog that Outlook uses from within my Delphi app - I assume there are COM classes to support this? What's the best way to get this done? Platform is Win7-64 with Outlook 2010.
TIA
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
免责声明:绝对可以通过 COM 来执行此操作,但 Outlook 将显示第 3 方应用程序正在访问地址簿的警告(理所当然)。如果您想避免这些警告,可以从 Outlook 加载项中运行代码、求助于 MAPI 或使用 Outlook Redemption,它基本上是 MAPI 的高级包装,感觉就像 Outlook 对象模型。
Outlook 对象模型提供 SelectNamesDialog对话框显示地址簿。它具有高度可配置性,您也可以使用自定义地址集对其进行初始化。
作为一个小例子,下面是一些在多选模式下弹出地址簿的代码。为简洁起见,它使用后期绑定 (OleVariants)。您可能希望在生产代码中使用早期绑定。
Disclaimer: It is definitely possible to do so through COM, but Outlook will display warnings that a 3rd party application is accessing the address book (and rightfully so). If you want to avoid these warnings, you can run the code from within an Outlook add-in, resort to MAPI, or use Outlook Redemption, which is basically an advanced wrapper around MAPI that feels like the Outlook Object Model.
The Outlook Object Model offers the SelectNamesDialog dialog to display the address book. It is highly configurable, and you can initialize it with custom sets of addresses as well.
As a little example, here is some code that pops up the address book in multiselect mode. For brevity, it uses late binding (OleVariants). You'll probably want to use early binding in production code.
要执行此类操作,您需要支持扩展 MAPI 接口。
以下是在 Win7-64 Outlook-2010 上支持此功能的组件的链接。
Easy MAPI
支持执行地址簿对话框。
To do something like this you need to support the Extended MAPI interface.
Here is a link to a component which supports this on Win7-64 Outlook-2010.
Easy MAPI
Supports execution of address book dialogs.