C#附件不显示在RDOAttachment对象中
我正在读取RDOAttachment对象,.Count属性为0,尽管outlook电子邮件在html电子邮件中嵌入了两张图片 If已将相同的代码从C#移植到Outlook中的VBA,并在那里正确显示 我是否做错了什么,或者RDOAttachment对象中是否存在错误 谢谢,C#附件不显示在RDOAttachment对象中,c#,outlook-redemption,C#,Outlook Redemption,我正在读取RDOAttachment对象,.Count属性为0,尽管outlook电子邮件在html电子邮件中嵌入了两张图片 If已将相同的代码从C#移植到Outlook中的VBA,并在那里正确显示 我是否做错了什么,或者RDOAttachment对象中是否存在错误 谢谢, Thomas您需要保存Outlook邮件,以便MAPI系统(和兑换)能够看到它。谢谢Dmitry,下面是一些关于代码的注释。我最初是在Outlook VBA中开发代码的,然后将其移植到VS C#,在那里它的性能会有所不同 我
Thomas您需要保存Outlook邮件,以便MAPI系统(和兑换)能够看到它。谢谢Dmitry,下面是一些关于代码的注释。我最初是在Outlook VBA中开发代码的,然后将其移植到VS C#,在那里它的性能会有所不同 我有一封签名的电子邮件,我想从电子邮件中删除签名,一旦完成,我会重新映射附件。从I_iMAPI安全邮件中删除密钥文件后,I_MAPI邮件中的附件将消失。VBA中的情况并非如此 如何解决这个问题
i_iMAPI = i_rdoS.GetRDOObjectFromOutlookObject(i_rdoMessage, true);
i_MAPI = i_rdoS.GetRDOObjectFromOutlookObject(i_rdoMessage);
//if signed message remove key file and set MessageClass to standard Message
if (i_iMAPI.MessageClass == "IPM.Note.SMIME.MultipartSigned")
{
i_iMAPI.MessageClass = "IPM.Note";
//remove the key file and make sure it is really key file
foreach (RDOAttachment att in i_iMAPI.Attachments)
{
if (att.DisplayName == "Untitled Attachment")
{
att.Delete();
}
}
//create specific Folder for each sender
i_FilePath = Folders.StorageFolder + i_MAPI.SenderName;
i_Folder.CreateFolder(i_FilePath);
//remapp the attachements from MAPI to iMAPI Message
foreach (RDOAttachment rdoAtt in i_MAPI.Attachments)
{
rdoAtt.SaveAsFile(i_FilePath + @"\" + rdoAtt.FileName);
i_iMAPI.Attachments.Add(i_FilePath + @"\" + rdoAtt.FileName);
i_iMAPI.Attachments[i_iMAPI.Attachments.Count].Hidden = rdoAtt.Hidden;
}
//save changes
i_iMAPI.Save();
}
在问题中包含您正在使用的代码,如果您收到任何错误,也要发布,这将帮助其他人更容易理解您的问题。