Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

How to: Customize Meeting Workspaces by Using the SharePoint Foundation Object Model

Published: May 2010

The following code examples show how to use the Microsoft SharePoint Foundation object model to work with Meeting Workspace sites.

To identify existing Meeting Workspace sites

  • The following code example prints the names of the Meeting Workspace sites that exist on the top-level site on the server.

    SPSite targetSite = new SPSite("http://server_name");
    SPWeb rootWeb = targetSite.OpenWeb("/");
    SPWebCollection spRootWebChildren = rootWeb.Webs;
    for (int i =0; i<spRootWebChildren.Count; i++)
    {
        if(spRootWebChildren[i].WebTemplateId == (int)SPWebTemplate.WebTemplate.Meetings)
        {
            Console.WriteLine(spRootWebChildren[i].Name.ToString());
        }
     }
    

To delete existing Meeting Workspace sites

  • The following code example deletes the Meeting Workspace site with the name "testmws" from the top-level site on the server.

    SPSite targetSite = new SPSite("http://server_name");
    SPWeb rootWeb = targetSite.OpenWeb("/");
    SPWebCollection spRootWebChildren = rootWeb.Webs;
    for (int i =0; i<spRootWebChildren.Count;i++)
    {
        if(spRootWebChildren[i].WebTemplateId == (int) SPWebTemplate.WebTemplate.Meetings)
        {
            if(spRootWebChildren[i].Name=="testmws")
                spRootWebChildren.Delete("testmws");
        }
    }
    
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.