在 Outlook 中获取选定的附件

发布于 2024-12-03 10:03:53 字数 375 浏览 2 评论 0原文

我正在使用一个插件,它使我能够将上下文菜单附加到 Outlook 附件。因此,当我单击附件时,我可以在上下文菜单中看到我的自定义按钮。

我面临的问题是,我如何知道点击了哪个附件。我脑子里有一些替代方案

  1. 当上下文菜单打开时,我可以将一个标签关联到该上下文菜单。在这个标签中,我可以存储附件的文件名。使用此文件名,我可以识别 context_menu_button_click 事件中的附件。目前,我找不到上下文菜单告诉打开上下文菜单的对象的位置。

  2. 我循环遍历检查器或任何其他对象中可用的一些属性,这些属性告诉我选择了电子邮件内的哪个对象。为此,我可以访问选定的电子邮件,也可以遍历所有附件,但我无法弄清楚选择了哪个附件(或右键单击)

I am using an addin which enable me to attach a context menu to outlook attachments. So when ever I click on an attachment I am able to see my custom button in the context menu .

The problem I am facing is, how do I know which attachment is clicked. I have some alternatives in my mind

  1. When context menu is opening, I can associate a tag to this context menu. In this tag , i can store the file name of the attachment. Using this file name I can identify the attachment in context_menu_button_click event. Currently I cannot find a place where context menu tells about the object, on which context menu was opened.

  2. I loop through some property available in inspector or any other object which tell me which object, inside the email is selected. For this, I can get to the selected email and I can also iterate through all attachments, but I cannot figure out which attachment is selected (or right clicked)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

耶耶耶 2024-12-10 10:03:53

感谢 这篇 SO 帖子

var attachmentSelection = (control.Context as AttachmentSelection).OfType<Attachment>();

可以翻译成...

AttachmentSelection attachmentSelection = control.Context as AttachmentSelection;

现在 使用 attachmentSelection 对象可能会解决问题......!

Thanks to this SO post

var attachmentSelection = (control.Context as AttachmentSelection).OfType<Attachment>();

Which can be translated into...

AttachmentSelection attachmentSelection = control.Context as AttachmentSelection;

Now using attachmentSelection object may solve the problem....!

兰花执着 2024-12-10 10:03:53

使用 Explorer/Inspector.AttachmentSelection 集合。

Use Explorer/Inspector.AttachmentSelection collection.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文