Hello
I'm creating a message template in Microsoft Outlook, with various custom fields.
One thing I need to do is record the raw email address (like joe@shmoe.com) of the sender and the recipient in custom fields. The code is being run while the user is composing the email, but after they put a name in the To line.
For the sender's email address, I have no problem, I am using this code:
txtSenderEmail.value = Application.GetNameSpace("MAPI").CurrentUser.Address
I have no problem capturing the recipient name resolved in the To line, but I want their email address only. I have
txtRecipientEmail = Item.To
In the To line it shows 'Joe Shmoe <joe@shmoe.com>' but that returns their name only to my txtRecipientEmail like 'Joe Shmoe'.
How can I extract only the SMTP email from this, and can I get to work for both Exchange Server recipients and SMTP recipients likewise?
Thanks in advance.
I'm creating a message template in Microsoft Outlook, with various custom fields.
One thing I need to do is record the raw email address (like joe@shmoe.com) of the sender and the recipient in custom fields. The code is being run while the user is composing the email, but after they put a name in the To line.
For the sender's email address, I have no problem, I am using this code:
txtSenderEmail.value = Application.GetNameSpace("MAPI").CurrentUser.Address
I have no problem capturing the recipient name resolved in the To line, but I want their email address only. I have
txtRecipientEmail = Item.To
In the To line it shows 'Joe Shmoe <joe@shmoe.com>' but that returns their name only to my txtRecipientEmail like 'Joe Shmoe'.
How can I extract only the SMTP email from this, and can I get to work for both Exchange Server recipients and SMTP recipients likewise?
Thanks in advance.