方法: プログラムによって会議出席依頼を作成する
この例では、Microsoft Office Outlook で会議出席依頼を作成し、その依頼を必要な出席者に送信します。
対象: このトピックの情報は、Outlook 2013 と Outlook 2010 のアプリケーション レベルのプロジェクトに適用されます。詳細については、「Office アプリケーションおよびプロジェクト タイプ別の使用可能な機能」を参照してください。
使用例
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();
}
}