我正在尝试将对位于共享点库中的文档的引用添加为 Outlook 电子邮件的附件。我收到以下错误:
File name or directory name is not valid.
我使用了这段代码:
String sSource = "http://lu3:333/TestList/Doc.txt ";
String sDisplayName = att.DisplayName;
int iPosition = (int)mail.Body.Length + 1;
int iAttachType = (int)Microsoft.Office.Interop.Outlook.OlAttachmentType.olByReference;
mail.Attachments.Add(sSource, iAttachType, iPosition, sDisplayName);
当我使用 OlAttachmentType.olByValue 时它可以工作,但通过引用它不是。
有人知道如何解决这个问题吗?或者是否有更好的解决方案将对位于 Sharepoint 站点中的文档的引用添加为附件?
感谢您的宝贵时间。
最佳答案
我认为您最好格式化 html 消息并使用标签或图像链接链接到文件。
可能有发送实际附件的理由,但如果可能的话,我会强烈反对。
关于c# - 通过引用 Sharepoint 文档添加 Outlook 附件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6578631/