gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-03 16:44:06 26 4
gpt4 key购买 nike

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

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com