Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have written some VBA that sends a bunch of email to internal email
address. I am using a table that contains their name not their email address and sometimes it will resolve to their correct email address, sometimes it won't. Is there a way to programmatically check to see if the email has resolved correctly? Currently I am using .Display and then manually sending if they are ok, or correcting if they are wrong, ideally I would like to ..Send them all and perhaps hold the ones that dont resolve. -- Trefor |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The Resolved Property of the Recipient Object returns True/False
depending on whether the recipient name has been resolved. Also the Resolve Method does the same thing. You can loop through the Recipients Collection and run the Resolve method on each one. If False, you can remove them from the Recipient list, build a string showing which recipients were removed, etc. --JP On Sep 16, 12:31*pm, Trefor wrote: I have written some VBA that sends a bunch of email to internal email address. I am using a table that contains their name not their email address and sometimes it will resolve to their correct email address, sometimes it won't. Is there a way to programmatically check to see if the email has resolved correctly? Currently I am using .Display and then manually sending if they are ok, or correcting if they are wrong, ideally I would like to .Send them all and perhaps hold the ones that don’t resolve. -- Trefor |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
JP,
Sounds good. Where I can get more info on this? I tried help on a few key words on your post, but could not find out any more details. Do you have a reference or sample code? -- Trefor "JP" wrote: The Resolved Property of the Recipient Object returns True/False depending on whether the recipient name has been resolved. Also the Resolve Method does the same thing. You can loop through the Recipients Collection and run the Resolve method on each one. If False, you can remove them from the Recipient list, build a string showing which recipients were removed, etc. --JP On Sep 16, 12:31 pm, Trefor wrote: I have written some VBA that sends a bunch of email to internal email address. I am using a table that contains their name not their email address and sometimes it will resolve to their correct email address, sometimes it won't. Is there a way to programmatically check to see if the email has resolved correctly? Currently I am using .Display and then manually sending if they are ok, or correcting if they are wrong, ideally I would like to .Send them all and perhaps hold the ones that dont resolve. -- Trefor |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In your code, you have to set an object reference to the Recipients
collection, because ResolveAll is a method of the Recipients collection. So your code would be Dim OutApp As Outlook.Application Dim OutMail As Outlook.MailItem Dim myRecipients As Outlook.Recipients Set OutApp = CreateObject("Outlook.Application") Set OutMail = OutApp.CreateItem(olMailItem) With OutMail .To = ETo .CC = Ecc .BCC = EBcc .Subject = ESubject .Body = Emsg If EDisplayorSend = "Display" Then .Display Exit Sub If EDisplayorSend = "Send" Then Set myRecipients = .Recipients If Not myRecipients.ResolveAll Then .Display Else .Send End If End If End With Set myRecipients = Nothing Set OutMail = Nothing Set OutApp = Nothing Just curious, why not try to change the inputs -- can you get the list of email addresses instead of the names? Is there any other way you can get a list of the email addresses? Maybe you can export the contact information (name and email address) from Outlook, then use VLOOKUP or a fuzzy match to match them to the names from your list. Where does the table come from that the names are written so differently than what they are in Outlook? --JP On Sep 18, 7:44*am, Trefor wrote: JP, Yes I understand if I construct the full email address I won't need to resolve them. Problem is I don't have the full email address and for some reason our names are full names including the middle name and to make it worse shortened name so: "Jones, Rodney John" Might be: "Jones, Rod" as a resolved name or |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Insert email address from Outlook into ActiveCell | Excel Programming | |||
Insert email address from Outlook into ActiveCell | Excel Programming | |||
open outlook and add email address | Excel Programming | |||
extracting email address from Outlook | Excel Programming | |||
Put Email Address from Excel to Outlook | Excel Programming |