다음을 통해 공유


방법: 약속 만들기

이 예제에서는 약속을 만들고 약속 모임 요청에 받는 사람을 추가합니다.

적용 대상: 이 항목의 정보는 Outlook 2007 및 Outlook 2010의 응용 프로그램 수준 프로젝트에 적용됩니다. 자세한 내용은 Office 응용 프로그램 및 프로젝트 형식에 따라 사용 가능한 기능을 참조하십시오.

예제

Private Sub AddAppointment()
    Dim newAppointment As Outlook.AppointmentItem = Me.Application.CreateItem _
         (Outlook.OlItemType.olAppointmentItem)
    Try
        With newAppointment
            .Start = Date.Now.AddHours(2)
            .End = Date.Now.AddHours(3)
            .Location = "ConferenceRoom #2345"
            .Body = _
                "We will discuss progress on the group project."
            .Subject = "Group Project"
            .AllDayEvent = False
            .Recipients.Add("Roger Harui")
            Dim sentTo As Outlook.Recipients = .Recipients
            Dim sentInvite As Outlook.Recipient
            sentInvite = sentTo.Add("Holly Holt")
            sentInvite.Type = Outlook.OlMeetingRecipientType.olRequired
            sentInvite = sentTo.Add("David Junca")
            sentInvite.Type = Outlook.OlMeetingRecipientType.olOptional
            sentTo.ResolveAll()
            .Save()
            .Display(True)
        End With
    Catch ex As Exception
        MsgBox("The following error occurred: " & _
            ex.Message)
    End Try
End Sub
private void AddAppointment()
{
    try
    {
        Outlook.AppointmentItem newAppointment =
            (Outlook.AppointmentItem)
        this.Application.CreateItem(Outlook.OlItemType.olAppointmentItem);
        newAppointment.Start = DateTime.Now.AddHours(2);
        newAppointment.End = DateTime.Now.AddHours(3);
        newAppointment.Location = "ConferenceRoom #2345";
        newAppointment.Body =
            "We will discuss progress on the group project.";
        newAppointment.AllDayEvent = false;
        newAppointment.Subject = "Group Project";
        newAppointment.Recipients.Add("Roger Harui");
        Outlook.Recipients sentTo = newAppointment.Recipients;
        Outlook.Recipient sentInvite = null;
        sentInvite = sentTo.Add("Holly Holt");
        sentInvite.Type = (int)Outlook.OlMeetingRecipientType
            .olRequired;
        sentInvite = sentTo.Add("David Junca ");
        sentInvite.Type = (int)Outlook.OlMeetingRecipientType
            .olOptional;
        sentTo.ResolveAll();
        newAppointment.Save();
        newAppointment.Display(true);
    }
    catch (Exception ex)
    {
        MessageBox.Show("The following error occurred: " + ex.Message);
    }
}

참고 항목

작업

방법: 사용자 지정 달력 만들기

방법: Outlook 연락처에 엔트리 추가

개념

달력 항목 작업