views:

119

answers:

1

Hi all,

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:

  • 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.

A: 
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();
}
Steve Danner
Hi Steve, Thanks for Reply. But, Here I dont have only 4 document library. I want this workflow to run when New Document Library is created. How can I get new document library name and run workflow when new document library is created.??Thanks again.
imsatasia