[英]Create folder in document library using SharePoint workflow
I want to create folder inside my document library based on other document library in the root. 我想基于根中的其他文档库在我的文档库中创建文件夹。 And I want to run this workflow on new document library creation.
我想在创建新文档库时运行此工作流。
So let say I have 4 document library: 所以说我有4个文档库:
I want to create folder inside "Archive" Document library when New document library is created. 创建新文档库时,我想在“存档”文档库中创建文件夹。
and in Archive document library it will create folders 并在存档文档库中创建文件夹
Is it possible..? 可能吗..?
How can I do it.?? 我该怎么做。??
-- -
Thanks in advance. 提前致谢。
string archiveListUrl = "http://myserver/Archive/";
SPSite site;
SPWeb web;
SPDocumentLibrary library;
using (site = new SPSite(archiveListUrl))
using (web = site.OpenWeb())
{
library = (SPDocumentLibrary)web.Lists["Archive"];
web.Folders.Add(archiveListUrl + "Help");
web.Folders.Add(archiveListUrl + "News");
web.Folders.Add(archiveListUrl + "Doc");
web.Folders.Add(archiveListUrl + "New Doc Library");
library.Update();
}
Thats difficult: Workflows are are always attached to one document/item. 那很困难:工作流总是附在一个文档/项目上。 One thing you could do: Create the Library from a customized template - and you can customize this lib with an workflow to start on creation of a doc.
您可以做的一件事:从自定义模板创建库-您可以使用工作流自定义该库以开始创建文档。 Then add a document to the library and save the whole thing as template with content.
然后将文档添加到库中,并将整个内容另存为带有内容的模板。
(Actually you might check if creating a lib template with existing folders might be easier...) (实际上,您可能会检查使用现有文件夹创建lib模板是否更容易...)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.