Create a Sharepoint List

  • 27 August 2005
  • 1 reply
  • 1 view

Badge +1
Hi there,

my process is currently creating a sharepoint site, and I'd like to the create a list (discussion board actually) from a sharepoint list template already in the sharepoint site's templates. my problem is, I can't find the enumeration for SpsListTemplateType (see 'xxxx' in my code below').

Even if I get the enumeration I'm not sure that this code will help me, as I need to load a List template, I don't see where that's occuring here.

Any help is apprectiated, thanks!

if (! (SpsList.CreateList(Site, "Comments", "Comments", xxxx,ref ErrorMessage)))
{
// Error Occurred in CreateWorkSpace - Raise Error
throw new System.Exception(ErrorMessage);
}
else
{
Console.WriteLine("Created Comments Discussion Board");
}

1 reply

Badge +2
Hi

Use Microsoft.SharePoint.SPListTemplateType.DiscussionBoard as your missing parameter.
Alternatively if you do not have a reference to Microsoft.SharePoint you could use 108.

Reply