Appointment Object

The Appointment object represents an appointment record associated with a new or existing account, business contact, or opportunity.

Version Information
Outlook 2007

Requirements

Business Contact Manager for Outlook

Remarks

To create a new appointment programmatically, do the following:

  1. Create an Outlook.AppointmentItem object and save it to the Outlook Calendar.
  2. Create a Outlook.JournalItem object of type Meeting.
  3. Set the Parent Entity EntryID Property property of the journal item to the entry ID of a new or existing account, business contact, or opportunity.

Appointment records appear in the Outlook Calendar, and should remain locked for the duration of the meeting. You must link an Appointment object with an Account, Business Contact, Opportunity, or Business Project object. The Communication History folder contains appointment items.

Example

The following C# and Visual Basic for Applications (VBA) examples show how to create a new object instance of type IPM.Appointment.

  [C#]
            Outlook.AppointmentItem appointmentItem = (Outlook.AppointmentItem)bcmHistoryFolder.Items.Add("IPM.Appointment");
            appointmentItem.Subject = "Meet to discuss the new architecture";
            appointmentItem.Body = "Need to finalize on the Architecture...";
            appointmentItem.Start = System.DateTime.Parse("3/20/2006 1:30:00 PM");
            appointmentItem.Duration = 40;
            appointmentItem.Save();

            Outlook.JournalItem newHistoryTaskItem = (Outlook.JournalItem)bcmHistoryFolder.Items.Add("IPM.Activity.BCM");
            newHistoryTaskItem.Subject = appointmentItem.Subject;
            newHistoryTaskItem.Start = appointmentItem.Start;
            newHistoryTaskItem.Duration = appointmentItem.Duration;
            newHistoryTaskItem.Type = "Meeting";
            
            //If the Outlook Appointment gets deleted, then the information is preserved in the Business Activity
            newHistoryTaskItem.Body = "StartDate: " + appointmentItem.Start + "\n" + "Duration: " + appointmentItem.Duration;

            if (newHistoryTaskItem.UserProperties["Parent Entity EntryID"] == null)
            {
                Outlook.UserProperty userProp = newHistoryTaskItem.UserProperties.Add("Parent Entity EntryID", Microsoft.Office.Interop.Outlook.OlUserPropertyType.olText, false, false);
                userProp.Value = newAcct.EntryID;
            }

            if (newHistoryTaskItem.UserProperties["LinkToOriginal"] == null)
            {
                Outlook.UserProperty userProp = newHistoryTaskItem.UserProperties.Add("LinkToOriginal", Microsoft.Office.Interop.Outlook.OlUserPropertyType.olText, false, false);
                userProp.Value = appointmentItem.EntryID;
            }

            newHistoryTaskItem.Save();


FakePre-eb88abf87b13475e8f44922ed5a546dc-594729e2c23540849eafbf160fec90b4

User Properties (Business Contact Manager only)

None. All properties derive from the parent object.

Parent Objects

AppointmentItem Object

For more information, download the Outlook 2007 Developer Reference by going to the 2007 Office System: Updated Developer Content Web site.

See Also

Business Notes | E-Mail Messages | Files | Phone Logs | Tasks