14-04-20 05:11 PM
Answered! Go to Answer.
14-04-20 09:18 PM
I didn't see an easy way to integrate this into the current code stage without tearing some things apart, so I made it as a separate action, leveraging PrimarySmtpAddress. I'm attaching the XML in a txt file, built in 6.7. You should be able to copy the contents to a clipboard, then paste it in as a new action tab in your VBO.
Alternatively, below is the code stage that I wrote if you want to get it working on your own. It takes the display name and current Outlook profile as an input, then spits out the e-mail address of the display name you've supplied.
Inputs
=====
Profile - Text - Profile name in Outlook, not inbox account e-mail address
displayName - Text - Use one of the names placed in the To/CC field(s) currently populated by the Outlook VBO
Outputs
======
smtpName - Text - The actual e-mail address associated with the display name being checked
Dim app = CreateObject("Outlook.Application") Dim _nameSpace = app.GetNameSpace("MAPI") Dim olSharedRecip as object Dim oEU as Object 'Outlook.ExchangeUser if Profile <> "" then _nameSpace.Logon(Profile, , True, True) end if olSharedRecip = _nameSpace.CreateRecipient(displayName) olSharedRecip.Resolve if olSharedRecip.Resolved then select case olSharedRecip.AddressEntry.AddressEntryUserType Case 0, 5 'olExchangeUserAddressEntry & olExchangeUserAddressEntry oEU = olSharedRecip.AddressEntry.GetExchangeUser if not (oEU is nothing) then smtpName = oEU.PrimarySmtpAddress end if Case 10, 30 'olOutlookContactAddressEntry & 'olSmtpAddressEntry smtpName = olSharedRecip.AddressEntry.Address end select end if
14-04-20 09:18 PM
I didn't see an easy way to integrate this into the current code stage without tearing some things apart, so I made it as a separate action, leveraging PrimarySmtpAddress. I'm attaching the XML in a txt file, built in 6.7. You should be able to copy the contents to a clipboard, then paste it in as a new action tab in your VBO.
Alternatively, below is the code stage that I wrote if you want to get it working on your own. It takes the display name and current Outlook profile as an input, then spits out the e-mail address of the display name you've supplied.
Inputs
=====
Profile - Text - Profile name in Outlook, not inbox account e-mail address
displayName - Text - Use one of the names placed in the To/CC field(s) currently populated by the Outlook VBO
Outputs
======
smtpName - Text - The actual e-mail address associated with the display name being checked
Dim app = CreateObject("Outlook.Application") Dim _nameSpace = app.GetNameSpace("MAPI") Dim olSharedRecip as object Dim oEU as Object 'Outlook.ExchangeUser if Profile <> "" then _nameSpace.Logon(Profile, , True, True) end if olSharedRecip = _nameSpace.CreateRecipient(displayName) olSharedRecip.Resolve if olSharedRecip.Resolved then select case olSharedRecip.AddressEntry.AddressEntryUserType Case 0, 5 'olExchangeUserAddressEntry & olExchangeUserAddressEntry oEU = olSharedRecip.AddressEntry.GetExchangeUser if not (oEU is nothing) then smtpName = oEU.PrimarySmtpAddress end if Case 10, 30 'olOutlookContactAddressEntry & 'olSmtpAddressEntry smtpName = olSharedRecip.AddressEntry.Address end select end if
15-04-20 04:46 AM
17-04-20 04:24 PM
17-04-20 04:40 PM
17-04-20 05:05 PM
04-11-21 10:19 AM
05-11-21 09:18 AM
16-06-23 07:18 AM
Hello Ami,
I am working on similar requirement but instead of Display Name, I have to search using the Employee ID.
We are getting only the Employee ID in input file in format "1234567" and When I put it in TO: email address and press CTRL+K, it populates the email address.
Could you please guide me how can I do this using code?
Thanks.
16-06-23 02:26 PM
In theory it should be the same code, as it's just using .Resolve against a string. I've used it against other inputs before (such as DN) and have seen success, but we unfortunately don't have IDs visible where I currently am to test against.