【发布时间】:2018-05-15 18:17:18
【问题描述】:
我的共享点事件接收器中有以下代码,用于在文档库中复制 .oft 文件并将其粘贴到新目标(另一个文档库)中:-
SPDocumentLibrary template = (SPDocumentLibrary)properties.Web.GetList(properties.Web.ServerRelativeUrl + "/Templates/");
SPListItem templetefile = null;
foreach (SPListItem i in template.Items)
{
if (i.Name.ToLower().Contains("project"))
{
templetefile = i;
}
}
byte[] fileBytes = templetefile.File.OpenBinary();
string destUrl = properties.Web.ServerRelativeUrl + "/" + projectid.RootFolder.Url +".oft";
SPFile destFile = projectid.RootFolder.Files.Add(destUrl, fileBytes, false);
现在我的代码运行良好。但我不确定我是否可以在复制 .OFT 文件后访问它,并修改其主题(主题是指我的电子邮件主题)??
【问题讨论】:
-
为什么不确定是否可以?你试过了吗?结果如何?
-
好像已经解决了,还是还有问题?