다음을 통해 공유


How to: Customize Meeting Workspaces Using the Windows SharePoint Services Object Model

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The following code examples show how to use the Windows SharePoint Services 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");
        }
    }
    

See Also

Reference

Microsoft.SharePoint.Meetings

Concepts

Namespaces in the Windows SharePoint Services Object Model