catch SenderEmailAddress on send events

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

catch SenderEmailAddress on send events
 
Karim




Posts: 170
Joined: 2006-01-02
Hi,

on adxOutlookAppEvents1ItemSend event i want to catch SenderEmailAddress but in Office 2010 SenderEmailAddress return Empty value

in Office 2013 this value is not empty

//....

IMail := Item as MailItem;

Inspector := OutlookApp.ActiveInspector;
if (assigned(Inspector) and assigned(Inspector.CurrentItem)) then
begin
Inspector.CurrentItem.QueryInterface(IID__MailItem, IMail);
end;

ol2010:= self.OutlookApp.Application as Outlook_Tlb._Application;


strSenderEmailAddress := IMail.SenderEmailAddress
showmessage(IMail.SenderEmailAddress);



I need SenderEmailAddress because i want filter item in send folder after item send like this


str_fltr :='[SenderEmailAddress] = "' + strSenderEmailAddress + '"';

ol2010objFolder.items.Restrict(str_fltr);
Posted 28 Nov, 2016 17:45:24 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
Hello Karim,

Karim writes:
on adxOutlookAppEvents1ItemSend event i want to catch SenderEmailAddress but in Office 2010 SenderEmailAddress return Empty value


I recommend that you make sure that the property is empty due to using Outlook 2010 (is it properly updated?) and not due to using a MAPI Store Provider such as GMail, HotMail, etc.

You would look into retrieving the email address using MailItem.SendUsingAccount (Outlook 2007+) and Account.SmtpAddress (Outlook 2007+).


Andrei Smolin
Add-in Express Team Leader
Posted 29 Nov, 2016 06:17:28 Top
Karim




Posts: 170
Joined: 2006-01-02
Hi,

If I understand the SenderEmailAddress property should not be empty
and this is probably due to the need to update Office 2010?
Posted 30 Nov, 2016 08:55:50 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
Hello Karim,

I suppose this property shouldn't be empty. This is why I suggest that you update Office. There are other variants. Check http://stackoverflow.com/questions/31984023/get-senderemailaddress-from-mail-item-in-compose-mode for instance.


Andrei Smolin
Add-in Express Team Leader
Posted 30 Nov, 2016 09:08:53 Top