VSTO:如何将拖放项目识别为电子邮件附件?
我有一个 VSTO 插件,允许用户将电子邮件拖放到列表框中的项目并保存。当用户拖动电子邮件附件时,我希望能够仅保存附件而不是整个电子邮件。
当前代码如下:
for (int i = 1; i <= OL.ActiveExplorer().Selection.Count; i++)
{
Object temp = OL.ActiveExplorer().Selection[i];
if (temp is Microsoft.Office.Interop.Outlook.MailItem)
{
Microsoft.Office.Interop.Outlook.MailItem mailitem =
(temp as Microsoft.Office.Interop.Outlook.MailItem);
我尝试使用:
if (temp is Microsoft.Office.Interop.Outlook.Attachment)
if (temp is Microsoft.Office.Interop.Outlook.Attachments)
来捕获它,但没有成功。
有什么方法可以确定丢弃的项目是否是电子邮件附件?
I have a VSTO add-in which allows users to drag n drop emails to an item in a listbox and save it. When a user drags an email attachment I would like to be able to save the attachment only and not the entire email.
Current code is as follows:
for (int i = 1; i <= OL.ActiveExplorer().Selection.Count; i++)
{
Object temp = OL.ActiveExplorer().Selection[i];
if (temp is Microsoft.Office.Interop.Outlook.MailItem)
{
Microsoft.Office.Interop.Outlook.MailItem mailitem =
(temp as Microsoft.Office.Interop.Outlook.MailItem);
I have tried using:
if (temp is Microsoft.Office.Interop.Outlook.Attachment)
if (temp is Microsoft.Office.Interop.Outlook.Attachments)
to trap it with no luck.
Is there any way to figure out if the item dropped is an email attachment?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论