Autor Beitrag
schaumermal
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 72



BeitragVerfasst: Fr 09.11.07 10:47 
Hi,

ich möchte gerne die markierte Mail in der Ansicht Posteingang in Outlook an meine Anwendung übertragen.
Das Add-In für Outlook habe ich bereits (Danke MKinzler) und müsste nun die Mail auslesen.
Kann mir jemand sagen wie ich auf die markierte/ aktive Mail in Outlook zugreifen kann?

Danke und Gruß

Kai
killavirus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 49

Win 2000
D5 Prof, D7 Prof
BeitragVerfasst: Di 20.11.07 11:12 
Hallo,

ich habe es leider bis jetzt noch nicht geschafft über das Plug-In auf die E-Mails zu zugreifen aber über "CreateOLEObject" geht es so:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
//initialize Outlook
outlook := CreateOLEObject('Outlook.Application');

//Selection object consisting of one or more items selected in the current view
If outlook.ActiveExplorer.Selection.count > 0 then begin
   // Zugriff auf das erste MailItem ...
   ShowMessage(outlook.ActiveExplorer.Selection.item(1).SenderName);
end;


Eine bereits geöffnete E-Mail kannst du so ansprechen:
ausblenden Delphi-Quelltext
1:
outlook.ActiveInspector.CurrentItem.SenderName;					


Wenn du das auslesen über das Plug-In schaffst dann bitte poste hier den Code ;)

Gruß Killa_Virus

_________________
I need a girl whose name doesn't end in .JPG
schaumermal Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 72



BeitragVerfasst: Di 20.11.07 23:42 
Hi,

ja ich habe es über das "Add In" geschafft auf die aktive Mail zuzugreifen.
Ich sende mal einen Codeauszug aus meinem Add In. In diesem Auszug sind verschiedene Funktionen zur Ermittlung von Detailinformationen der eMail's enthalten.

Viel Spaß

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
function TOutlookAddIn.eMailAdresseExtrahieren:String;
var App : OleVariant;
begin
     try
        App:=CreateOleObject('Outlook.Application');
        Result:=App.ActiveExplorer.Selection.Item(1).SenderEmailAddress;

        if Pos('@',Result)=0 then
           Result:=App.ActiveExplorer.Selection.Item(1).SenderName;

     finally
         App := unassigned;
     end;
end;

function TOutlookAddIn.eMailEmpfaengerExtrahieren:String;
var App : OleVariant;
begin
     try
        App:=CreateOleObject('Outlook.Application');

        Result:=App.ActiveExplorer.Selection.Item(1).To;
     finally
         App := unassigned;
     end;
end;

function TOutlookAddIn.eMailBetreffExtrahieren:String;
var App : OleVariant;
begin
     try
        App:=CreateOleObject('Outlook.Application');

        Result:=App.ActiveExplorer.Selection.Item(1).Subject;
     finally
         App := unassigned;
     end;
end;

function TOutlookAddIn.eMailBodyExtrahieren:Variant;
var App : OleVariant;
begin
     try
        App:=CreateOleObject('Outlook.Application');

        Result:=App.ActiveExplorer.Selection.Item(1).Body;
     finally
         App := unassigned;
     end;
end;

function TOutlookAddIn.eMailAnhaengeErmitteln:Integer;
var App : OleVariant;
begin
     try
        App:=CreateOleObject('Outlook.Application');

        Result:=App.ActiveExplorer.Selection.Item(1).Attachments.Count;

     finally
         App := unassigned;
     end;
end;


Moderiert von user profile iconjasocul: Delphi-Tags hinzugefügt