Board index » delphi » Setting an Appointment in Outlook from Delphi

Setting an Appointment in Outlook from Delphi

What is the proper syntax for creating an appointment in Outlook from
Delphi.  I need to set the date and time of the appointment as well as make
it have a reminder.  I don't want the appointment to show busy on the
calendar but I would like to set it to Free, I am unsure how to do this.  I
also need to set this appointment up for other Recipients, again I am unsure
of this.  Any help would be greatful!  Below is what I currently have and is
working great except for I need to add Recipients, a start and end date and
time, and make the appointment Free not busy (which is the default).
Thanks.
var
    OlApp: _Application;
    Appointment: AppointmentItem;
begin
    //create the outlook application object
    OlApp := CoOutlookApplication.Create();
    try
        //create the appointment item
        Appointment := OlApp.CreateItem(olAppointmentItem) as
AppointmentItem;
        //set the details of the appointment
        Appointment.Subject := 'Testing';
        Appointment.Body := 'Testing';
        Appointment.ReminderSet;
        Appointment.ReminderMinutesBeforeStart := 1
        Appointment.Save;
    finally
        OlApp.Quit;
        OlApp := nil
    end;
end;

Nicole

 

Re:Setting an Appointment in Outlook from Delphi


See Appointmenttem.BusyStatus, Start and End properties. To create appointments
for other users in the Exchange environment, you first need to get to their
Calendar folders - use Namespace.GetSharedDefaultFolder() method.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool

Quote
"Nicole Krueger" <NicoleKrue...@meritcare.com> wrote in message

news:3ce261b6$1_2@dnews...
Quote
> What is the proper syntax for creating an appointment in Outlook from
> Delphi.  I need to set the date and time of the appointment as well as make
> it have a reminder.  I don't want the appointment to show busy on the
> calendar but I would like to set it to Free, I am unsure how to do this.  I
> also need to set this appointment up for other Recipients, again I am unsure
> of this.  Any help would be greatful!  Below is what I currently have and is
> working great except for I need to add Recipients, a start and end date and
> time, and make the appointment Free not busy (which is the default).
> Thanks.
> var
>     OlApp: _Application;
>     Appointment: AppointmentItem;
> begin
>     file://create the outlook application object
>     OlApp := CoOutlookApplication.Create();
>     try
>         file://create the appointment item
>         Appointment := OlApp.CreateItem(olAppointmentItem) as
> AppointmentItem;
>         file://set the details of the appointment
>         Appointment.Subject := 'Testing';
>         Appointment.Body := 'Testing';
>         Appointment.ReminderSet;
>         Appointment.ReminderMinutesBeforeStart := 1
>         Appointment.Save;
>     finally
>         OlApp.Quit;
>         OlApp := nil
>     end;
> end;

> Nicole

Other Threads