Uses Comobj;
procedure TForm1.cxButton1Click(Sender: TObject);
var
Outlook,objAppointment: OleVariant;
Mail: Variant;
const
olMailItem = $00000000;
olAppointmentItem = 1;
begin
try
Outlook := GetActiveOleObject('Outlook.Application');
objAppointment := Outlook.CreateItem(olAppointmentItem)
except
Outlook := CreateOleObject('Outlook.Application');
end;
objAppointment.Start := '4/11/2005 11:00 AM' ;
objAppointment.Duration := 60 ;
objAppointment.Subject := 'Scripting Guys Planning Session' ;
objAppointment.Body := 'Meet with Scripting Guys to discuss upcoming plans.' ;
objAppointment.Location := '44/2039' ;
objAppointment.ReminderMinutesBeforeStart := 15 ;
objAppointment.ReminderSet := True;
objAppointment.Save ;
end;
No comments:
Post a Comment