Distribution Lists Not Bolded (via VBA)

G

GHH

I wrote some VBA to create about 100 EMails, paste the contents of Excel
worksheets into the bodies, place distribution lists in To and BCC, and save
the Emails to the Drafts folder. The distribution lists do not populate and
turn bold/underlined as they do when manually selected and inserted.

In order to get them to do so, the user has to open each Email and wait --
some will populate themselves, and others have to be manually selected.

I tried to fix this issue by using the ResolveAll method as shown below, but
the distribution lists still are not bold/underlined.

Set objEmail = objOutlook.CreateItem(0) ' olMailItem
Set myRecipients = objEmail.Recipients
With objEmail
.To = strto
.CC = strCC
.BCC = strBCC
.Subject = strSubject
.Body = strbody
.Save
End With
If Not myRecipients.ResolveAll Then
For Each myRecipient In myRecipients
myRecipient.Resolve
If Not myRecipient.Resolved Then
MsgBox myRecipient.Name
End If
Next
End If

Can anyone tell me what I'm doing wrong?

Thanks,

Randy
 
G

GHH

Michael - thank you very much for the tip, everything is working fine now.
Well, almost everything -- I still have one distrubition list that refuses to
resolve with the code. Sometimes it will do so by itself by leaving the
Email open for a little while, or moving it from To: to Cc: and back again
will do it... or choosing it from the directory. I think that my users are
pleased enough having 99% less distribution lists to worry about.

Thanks again,

Randy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top