How do I get the recipients email addresses for emails that are sent

Add-in Express™ Support Service
That's what is more important than anything else

How do I get the recipients email addresses for emails that are sent
 
Jon Gill




Posts: 35
Joined: 2005-03-11
I am using the following code, which works. However, when I get objitem.to it only returns the "display name" of an email address, which may only just be persons name and not the email address. I want to get the full email address. Any ideas?


procedure TAddInModule.adxOutlookAppEvents1ItemSend(ASender: TObject;
const Item: IDispatch; var Cancel: WordBool);

VAR
outlook: olevariant;
myitem: olevariant;
objitem: olevariant;
isecuritymanager: olevariant;
begin
iSecurityManager := CreateOLEObject('AddInExpress.OutlookSecurityManager');
try
isecuritymanager.DisableoomWarnings := True;
except
isecuritymanager.DisableoomWarnings := False;
end;
try
Outlook := GetActiveOleObject('Outlook.Application');
except
Outlook := CreateOleObject('Outlook.Application');
end;

myitem:=outlook.activeinspector;
objItem:= myItem.CurrentItem;

SHOWMESSAGE(objitem.to+' '+objitem.cc+' '+objitem.bcc+' '+objitem.subject+' '+objitem.body);

isecuritymanager.DisableoomWarnings := false;
isecuritymanager:=unassigned;
OUTLOOK:=UNASSIGNED;
end;
Posted 19 Aug, 2006 11:48:58 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Jon,

See the Recipients collection of the MailItem interface.

Posted 25 Aug, 2006 08:24:09 Top