Share via


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)

Syntax

'Declaration
Public Shared Function GetMeetingInformation ( _
    web As SPWeb _
) As SPMeeting
'Usage
Dim web As SPWeb
Dim returnValue As SPMeeting

returnValue = SPMeeting.GetMeetingInformation(web)
public static SPMeeting GetMeetingInformation(
    SPWeb web
)

Parameters

Return Value

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

Remarks

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.

Note

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

Examples

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.

Imports System
Imports Microsoft.SharePoint
Imports Microsoft.SharePoint.Meetings

Module ConsoleApp
   Sub Main()
      Using siteCollection As SPSite = New SPSite("https://localhost")
         Using rootWeb As SPWeb = siteCollection.RootWeb

            Dim web As SPWeb
            For Each web In rootWeb.Webs
               If SPMeeting.IsMeetingWorkspaceWeb(web) Then
                  ' Get a meeting object.
                  Dim meeting As SPMeeting = SPMeeting.GetMeetingInformation(web)

                  ' Print the workspace URL.
                  Dim url As String = web.Url + "/default.aspx?InstanceID=" + meeting.InstanceId.ToString()
                  Console.WriteLine(url)
               End If
               ' Clean up.
               web.Dispose()
            Next web

         End Using
      End Using
      Console.Write(vbCrLf + "Press ENTER to continue...")
      Console.ReadLine()
   End Sub
End Module
using System;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Meetings;

namespace Test
{
   class ConsoleApp
   {
      static void Main(string[] args)
      {
         using (SPSite siteCollection = new SPSite("https://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();
      }
   }
}

See Also

Reference

SPMeeting Class

SPMeeting Members

Microsoft.SharePoint.Meetings Namespace

IsMeetingWorkspaceWeb

GetWorkspacesToLinkTo