【发布时间】:2020-07-22 08:02:21
【问题描述】:
我需要直接从邮件中打开邮件文件附件。假设我有 .txt 文件。我已经将它附加到我的邮件中。但是现在我需要打开它,更改一些单词并保存它(它是手动部分)。我怎样才能做到这一点?我的代码是:
private void button2_Click(object sender, EventArgs e)
{
Outlook.Inspector currInspector = null;
Outlook.MailItem mail = null;
Outlook.Attachments attachments = null;
currInspector = Globals.ThisAddIn.Application.ActiveInspector();
if (currInspector != null) {
mail = (Outlook.MailItem)currInspector.CurrentItem;
attachments = mail.Attachments;
attachments.Add(@"C:\install\CSharp\tulemus.txt", Outlook.OlAttachmentType.olByValue);
}
【问题讨论】:
标签: c# email outlook vsto attachment