Hallo,
ich möchte eine neue pst-Date erstellen und in diese Datei Kontakte eintragen. Ich habe mir das wie folgt vorgestellt
procedure NeuePST;
var
Outlook : OleVariant;
NameSpace : OleVariant;
ContactsFolder : OleVariant;
OutlookContact : OleVariant;
begin
Outlook := CreateOleObject('Outlook.Application');
Try
NameSpace := Outlook.GetNameSpace('MAPI');
Namespace.AddStore ('Meine.pst');
Try
ContactsFolder := NameSpace.Folders.GetLast;
OutlookContact := ContactsFolder.Items.Add;
..ab hier werden die Werte zugewiesen
OutlookContact.save;
Finally
NameSpace.RemoveStore(ContactsFolder);
End;
finally
Outlook := Unassigned;
End;
end;
Die pst-Datei wird erstellt, jedoch kein Kontakt eingetragen. Hat jemand so etwas schon gemacht ?
MfG Harald
ich möchte eine neue pst-Date erstellen und in diese Datei Kontakte eintragen. Ich habe mir das wie folgt vorgestellt
procedure NeuePST;
var
Outlook : OleVariant;
NameSpace : OleVariant;
ContactsFolder : OleVariant;
OutlookContact : OleVariant;
begin
Outlook := CreateOleObject('Outlook.Application');
Try
NameSpace := Outlook.GetNameSpace('MAPI');
Namespace.AddStore ('Meine.pst');
Try
ContactsFolder := NameSpace.Folders.GetLast;
OutlookContact := ContactsFolder.Items.Add;
..ab hier werden die Werte zugewiesen
OutlookContact.save;
Finally
NameSpace.RemoveStore(ContactsFolder);
End;
finally
Outlook := Unassigned;
End;
end;
Die pst-Datei wird erstellt, jedoch kein Kontakt eingetragen. Hat jemand so etwas schon gemacht ?
MfG Harald