c# - 通过引用 Sharepoint 文档添加 Outlook 附件

标签 c# sharepoint outlook

我正在尝试将对位于共享点库中的文档的引用添加为 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/

相关文章:

c# - 如何以编程方式从 Windows 联系人中检索所有联系人的详细信息?

javascript - 单击时显示/隐藏

delphi - 如何使用 Delphi 创建 Outlook 插件?

vba - Outlook VBA 未在某些 Windows 10 计算机上返回 CurrentUser Recipient 对象

c# - 异步 LoadImage 例程挂起

c# - 团结 : is it possible to configure the scene for trigger colliders to only work with one layer?

c# - 获取计数和名称

html - CSS 应用于默认菜单

css - Sharepoint 2013 任务列表中元素的样式

c++ - 如何在 C++ 中检查 Microsoft Outlook 是否打开?