Guest
Guest
|
Hi, I took your OutlookSkeleton1 and added a bar with a button. In the onclick I have
ShowMessage(OutlookApp.ActiveInspector.Caption);
ShowMessage(OutlookApp.ActiveExplorer.Caption);
Line 1 does throw an error, line 2 is ok.
My goal: Get to the currently selected MailItem to e. g. show the .Body.
Thanks! |
|
Dmitry Kostochko
Add-in Express team
Posts: 2887
Joined: 2004-04-05
|
Hi Guest,
Try the following code:
begin
if OutlookApp.ActiveExplorer <> nil then
if OutlookApp.ActiveExplorer.Selection.Count > 0 then begin
OutlookApp.ActiveExplorer.Selection.Item(1).QueryInterface(IID__MailItem, IMail);
if Assigned(IMail) then
try
ShowMessage(IMail.Body);
finally
IMail := nil;
end;
end;
end;
|
|