unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, ComCtrls,ComObj, OutlookXP, Mask;
type
TForm1 =
class(TForm)
BitBtnCalender: TBitBtn;
DateTimePicker1: TDateTimePicker;
EditSubject: TEdit;
EditLocation: TEdit;
MemoBody: TMemo;
Zeit: TMaskEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Dauer: TEdit;
Label6: TLabel;
Label7: TLabel;
procedure BitBtnCalenderClick(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.BitBtnCalenderClick(Sender: TObject);
var
aOutlook : Variant;
aMAPI : Variant;
aFolder : Variant;
aCalendar : Variant;
begin
Screen.Cursor := crHourglass;
aOutlook := CreateOleObject('
Outlook.Application');
try
aMAPI := aOutlook.GetNameSpace('
MAPI');
aFolder := aMAPI.GetDefaultFolder(olFolderCalendar);
aCalendar := aMAPI.GetDefaultFolder(olFolderCalendar).Items.Add;
aCalendar.Start := StrToTime(Zeit.Text) + Int(DateTimePicker1.Date);
aCalendar.Duration := StrToInt(Dauer.Text);
aCalendar.Subject := EditSubject.Text;
aCalendar.ReminderMinutesBeforeStart := 30;
aCalendar.ReminderPlaySound := True;
aCalendar.ReminderSet := True;
aCalendar.Location := EditLocation.Text;
aCalendar.Body := MemoBody.Text;
aCalendar.Save;
finally
aOutlook := Unassigned;
Screen.Cursor := crDefault;
end;
end;
end.