13-12-18 07:43 PM
14-12-18 07:06 AM
19-12-18 03:02 AM
19-12-18 03:55 AM
16-03-20 04:55 PM
17-03-20 01:11 PM
public string GetSenderAddress(MailItem mail) { // Checks if the sender is an Exchange address. if (mail.SenderEmailType == "EX") { // Checks if the sender is a distrubtion list, which requires a different function call to // get the email address instead of the exchange address. if (mail.Sender.AddressEntryUserType == OlAddressEntryUserType.olExchangeDistributionListAddressEntry) { return mail.Sender.GetExchangeDistributionList().PrimarySmtpAddress; } else { return mail.Sender.GetExchangeUser().PrimarySmtpAddress; } // If the sender is not an exchange address (which typically means it's an external email), // SenderEmailAddress will contain the correct email address. } else { return mail.SenderEmailAddress; } }
You'll have to adapt it to the Outlook VBO, but this should get the email address instead of the Exchange string for distribution lists. It's very similar code to resolve the To/CC/BCC fields to the correct email address if you have problems with those too.
17-03-20 05:48 PM
Row ("SenderEmailAddress") = If (item.SenderEmailType = "EX",if(item.Sender.AddressEntryUserType = OlAddressEntryUserType.olExchangeDistributionListAddressEntry,item.Sender.GetExchangeDistributionList.PrimarySmtpAddress,item.Sender.GetExchangeUser.PrimarySmtpAddress),item.SenderEmailAddress)