![]() ![]() ResolveDisplayNameToSMTP = oEU.PrimarySmtpAddressĬase 10, 30 'olOutlookContactAddressEntry & 'olSmtpAddressEntry Select Case Ĭase 0, 5 'olExchangeUserAddressEntry & olExchangeRemoteUserAddressEntry Set OLApp = CreateObject("Outlook.Application") "James Smith") and turns it into an email address necessary because the Outlook address is a long, convoluted string when the email is going to someone in the organization.ĭim oEDL As Object 'Outlook.ExchangeDistributionList I found this function from another StackOverflow answer helpful: Function ResolveDisplayNameToSMTP(sFromName) As String If the email is inside your organization, you need to convert it to an SMTP email address. GetRecepientEmailAddres = Join(out.ToArray(), " ") Out.Add ResolveDisplayNameToSMTP(emlAddr) ![]() Set out = CreateObject("") ' a JavaScript-y array Function getRecepientEmailAddress(eml As Variant) Combining it with another S/O answer to convert inner-company email display names to SMTP names, this does the trick. I wanted a semicolon-delaminated list of email addresses that were either in my Exchange organization or outside of it. OUTLOOK EMAIL ADDRESS EXTRACTOR FOR OUTLOOK 2016 CODEThe Microsoft code was giving me an error, and some investigating reveals that the schema page is no longer available. It looks like, for email addresses outside of your organization, the SMTP address is hidden in emailObject.Recipients(i).Address, though it doesn't seem to allow you to distinguish To/CC/BCC. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |