SPMeeting.GetMeetingInformation method

Gets an SPMeeting object that has meeting information for the specified Web site.

Namespace:  Microsoft.SharePoint.Meetings
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

public static SPMeeting GetMeetingInformation(
	SPWeb web
)

Parameters

web
Type: Microsoft.SharePoint.SPWeb

An object that represents a Web site.

Return value

Type: Microsoft.SharePoint.Meetings.SPMeeting
A Meeting Information object for the specified Web site.

The GetMeetingInformation method returns an SPMeeting object with meeting information about the Web site that you specify in the method’s only parameter. If you specify a Web site that was created by using one of the Meeting Workspace templates, then you can use the SPMeeting object that is returned to get information about the content of the workspace. You can also specify a Web site that is not a workspace itself but is the parent of subsites that are Meeting Workspace sites. In that case, you can use the SPMeeting object that is returned to call the GetWorkspacesToLinkTo(Boolean) method, which retrieves an SPWebCollection object that contains subsites that are Meeting Workspaces.

NoteNote

The GetMeetingInformation method is the only way to get an instance of the SPMeeting class. The class has no public constructor.

The following example is a console application that finds all Meeting Workspace sites that are immediately below the root Web site in a site collection. The application prints the URL for each workspace that it finds to the console.

using System;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Meetings;

namespace Test
{
   class ConsoleApp
   {
      static void Main(string[] args)
      {
         using (SPSite siteCollection = new SPSite("http://localhost"))
         {
            using (SPWeb rootWeb = siteCollection.RootWeb)
            {
               foreach (SPWeb web in rootWeb.Webs)
               {
                  if (SPMeeting.IsMeetingWorkspaceWeb(web))
                  {
                     // Get a meeting object.
                     SPMeeting meeting = SPMeeting.GetMeetingInformation(web);

                     // Print the workspace URL.
                     string url = web.Url + "/default.aspx?InstanceID=" + meeting.InstanceId.ToString();
                     Console.WriteLine(url);
                  }
                  // Clean up.
                  web.Dispose();
               }
            }
         }
         Console.Write("\nPress ENTER to continue...");
         Console.ReadLine();
      }
   }
}
Show: