LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 201
Default Checking Outlook Email Address

JP,

Many thanks for you help, your comments prompted to look in the Outlook
forum and I found a few hints and just tested by revised code (which is
essentially what you said below).

If EDisplayorSend = "Send" Then
If .Recipients.ResolveAll Then
.Send
Else
.Display
End If
Else
.Display
End If

--
Trefor


"JP" wrote:

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


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert email address from Outlook into ActiveCell LuisE Excel Programming 0 December 17th 07 10:00 PM
Insert email address from Outlook into ActiveCell LuisE Excel Programming 0 December 17th 07 10:00 PM
open outlook and add email address Debbie Horner Excel Programming 5 November 8th 07 12:12 AM
extracting email address from Outlook Daminc[_37_] Excel Programming 1 January 26th 06 03:14 PM
Put Email Address from Excel to Outlook Terry Excel Programming 1 January 29th 04 08:40 AM


All times are GMT +1. The time now is 05:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"