Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Outlook Kontakt erstellen (https://www.delphipraxis.net/55843-outlook-kontakt-erstellen.html)

Micha 27. Okt 2005 20:02


Outlook Kontakt erstellen
 
Viele haben in ihren E-Mail am Ende Signaturen stehen.
Ich hätte gerne, dass man diese markieren kann, auf eine Form ziehen kann und dann automatisch ein Outlook-Kontakt-Fenster geöffnet wird und die Daten in die entsprechenden Feleder geschrieben werden.

Das Herausfiltern der einzelnen Daten (Postleitzahl, Ort etc.) dürfte vorerst kein Problem darstellen.

Woran ich scheitere, ist der Aufruf des Outlook-Fenster.
Ich habe mir den Code aus dem Thread http://www.delphipraxis.net/internal...utlook+kontakt teilweise übernommen, aber es klappt nicht.

Delphi-Quellcode:

var
  Form1: TForm1;
  MyNameSpace : Namespace;
  vContact, vMail, vAppoint : Variant;

procedure TForm1.Button1Click(Sender: TObject);
begin
  OutlookApplication1.Connect;
  MyNameSpace := OutlookApplication1.GetNamespace('MAPI');
  MyNameSpace.Logon('','',True,True);

   ContactItem1.ConnectTo(ContactItem(OutlookApplication1.CreateItem(olContactItem)));
   ContactItem1.FirstName := 'Harry';
   ContactItem1.LastName := 'Hirsch';
   ContactItem1.Display(vContact);
end;
Kann mir jemand sagen, was ich falsch mache? Ich arbeite mit Outlook 2003

Vielen Dank im Voraus.


Alle Zeitangaben in WEZ +1. Es ist jetzt 23:45 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz