繁体   English   中英

C#VSTO MailItem.Attachments

[英]c# VSTO MailItem.Attachments

如何检查MailItem.Attachments是否已包含具有相同文件路径的附件?

就像是

if (!MailItem.Attachments.Contains("this"){
  //add it
}

Attachments集合不是从System.Collections继承的,因此您不能使用典型的List方法。 您将必须遍历每个附件(使用Outlook对象的for,而不是for),以评估Attachment.FileName属性。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM