[英]How to attach a attachment file to a list item using REST API in SharePoint 2013
[英]How to attach a current Word document to a new Sharepoint 2013 list item
我正在开发一个单词插件。 我需要在现有的 Sharepoint 列表中创建一个新项目,使用当前文档,如附件。
var attInfo = new AttachmentCreationInformation();
attInfo.FileName = "Test";
attInfo.ContentStream = new MemoryStream(System.IO.File.ReadAllBytes(**here my current document**));
ListItemCreationInformation itemCreateInfo = new ListItemCreationInformation();
ListItem oListItem = oList.AddItem(itemCreateInfo);
oListItem["Title"] = "My New Item!";
oListItem.AttachmentFiles.Add(attInfo);
我如何将当前文档放在那里。 感谢你的帮助。 问候
保存文档后,** ActiveDocument ** Path 属性,有完整路径
attInfo.ContentStream = new MemoryStream(System.IO.File.ReadAllBytes(**Globals.ThisAddIn.ActiveDocument.FullName**));
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.