如何:创建会议请求

更新:2007 年 11 月

适用对象

本主题中的信息仅适用于指定的 Visual Studio Tools for Office 项目和 Microsoft Office 版本。

项目类型

  • 应用程序级项目

Microsoft Office 版本

  • Outlook 2003

  • Outlook 2007

有关更多信息,请参见按应用程序和项目类型提供的功能

此示例在 Microsoft Office Outlook 中创建会议请求,并将此请求发送给所需与会者。

示例

Private Sub ThisAddIn_Startup(ByVal sender As Object, _
 ByVal e As System.EventArgs) Handles Me.Startup
    Dim agendaMeeting As Outlook.AppointmentItem = CType( _
        Me.Application.CreateItem(Outlook.OlItemType.olAppointmentItem),  _
        Outlook.AppointmentItem)

    If agendaMeeting IsNot Nothing Then
        agendaMeeting.MeetingStatus = _
            Outlook.OlMeetingStatus.olMeeting
        agendaMeeting.Location = "Conference Room"
        agendaMeeting.Subject = "Discussing the Agenda"
        agendaMeeting.Body = "Let's get together to discuss the " _
            & "agenda."
        agendaMeeting.Start = New System.DateTime( _
            2005, 5, 5, 5, 0, 0)
        agendaMeeting.Duration = 60
        Dim recipient As Outlook.Recipient = _
            agendaMeeting.Recipients.Add("Nate Sun")
        recipient.Type = Outlook.OlMeetingRecipientType.olRequired

        agendaMeeting.Send()

    End If
End Sub
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
    Outlook.AppointmentItem agendaMeeting = (Outlook.AppointmentItem)
        this.Application.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.
        olAppointmentItem);

    if (agendaMeeting != null)
    {
        agendaMeeting.MeetingStatus =
            Microsoft.Office.Interop.Outlook.OlMeetingStatus.olMeeting;
        agendaMeeting.Location = "Conference Room";
        agendaMeeting.Subject = "Discussing the Agenda";
        agendaMeeting.Body = "Let's discuss the agenda.";
        agendaMeeting.Start = new DateTime(2005, 5, 5, 5, 0, 0);
        agendaMeeting.Duration = 60;
        Outlook.Recipient recipient =
            agendaMeeting.Recipients.Add("Nate Sun");
        recipient.Type =
            (int)Outlook.OlMeetingRecipientType.olRequired;
        ((Outlook._AppointmentItem)agendaMeeting).Send();
    }
}

请参见

概念

使用日历项

应用程序级外接程序编程入门