Code snippet to download the files along with versions from SPS 2003 document library.

1: private void Download() 2: { 3: string siteUrl = txtSite.Text.ToString(); 4: string source = txtDocLib.Text.ToString(); 5: string downloadPath= txtDownload.Text.ToString(); 6: byte[] vContent = null; 7: int count = 1; 8:   9: using (SPSite site = new SPSite(siteUrl)) 10: { 11: using (SPWeb web = site.OpenWeb()) 12: { 13: SPFolder sourceFolder = web.GetFolder(source); 14:…

0

How To: Access item metadata from workflow when associated in document library

Problem There is a workflow which accesses the item metadata on workflow activated. In case of document library, when you upload a document, if the workflow is set to start on ItemAdded, it will start just after upload is done and before you completely fill up the metadata information of the item. Since it is…

0

How To: Add a permission group in the document library's folders

This is the snippet which will add a permission group in the document library’s folders. 1: using System; 2: using System.Collections.Generic; 3: using System.Text; 4: using Microsoft.SharePoint; 5: 6: namespace ConsoleApplication1 7: { 8: class Program 9: { 10: static void Main(string[] args) 11: { 12: Console.WriteLine("Enter your site URL"); 13: string strSiteName = Console.ReadLine();…

0

Resolution: MOSS: Custom document library doesn't display metadata with more than one content type

Behavior/Symptoms: If you add more than one content type to a custom (programmatically created) document library, the metadata is not displayed in the Web Properties pop up box at the time of saving the document. Cause: After comparing schema.xml before applying SP1 to another schema.xml file after applying SP1, following lines of code was missing:…

0