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
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