다음을 통해 공유


프로그래밍 방식으로 모임 요청 만들기

이 예제에서는 Microsoft Office Outlook에서 모임 요청을 만들고 필요한 참석자에게 요청을 보냅니다.

적용 대상: 이 항목의 정보는 Outlook의 VSTO 추가 기능 프로젝트에 적용됩니다. 자세한 내용은 Office 애플리케이션 및 프로젝트 형식에 따라 사용 가능한 기능을 참조하세요.

예시

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();
    }
}