简体   繁体   English

使用SharePoint工作流在文档库中创建文件夹

[英]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个文档库:

  • Help 救命
  • News 新闻
  • Doc 文件
  • Archive 封存

I want to create folder inside "Archive" Document library when New document library is created. 创建新文档库时,我想在“存档”文档库中创建文件夹。

  • Help 救命
  • News 新闻
  • Doc 文件
  • Archive 封存
  • New Doc Library 新文件库

and in Archive document library it will create folders 并在存档文档库中创建文件夹

  • Help 救命
  • News 新闻
  • Doc 文件
  • New Doc Library 新文件库

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.

相关问题 使用客户端对象模型在SharePoint文档库上创建文件夹 - Create folder on SharePoint document library using client object model 使用Sharepoint事件接收器在文档库中创建一个文件夹 - Create a folder in document library using Sharepoint event receiver 使用SharePoint Client对象模型共享文档库中的特定文件夹 - Share specific folder in document library using SharePoint Client Object Model sharepoint 2013 使用列表模板 C# 创建文档库 - sharepoint 2013 create document library using List Template C# 如何检查Sharepoint文档库上的文件夹出口 - How to Check Folder Exits on Sharepoint Document Library 识别Sharepoint文档库中的“ Forms”文件夹 - Identify “Forms” folder in a Sharepoint document library 在SharePoint Online(CSOM)内检查和在文档库中创建文件夹的最佳方法? - Fatest way to check and create folder in document library within SharePoint Online (CSOM)? 从SharePoint文档库URL中提取文件夹/子文件夹名称 - Extracting folder/sub folder name from SharePoint document library URL 使用CMIS和Sharepoint创建文件夹 - Create folder using CMIS and Sharepoint 将SharePoint文件夹和内容移动到同一文档库中的不同位置 - Moving a SharePoint folder and contents to different location in same Document Library
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM