Justin_M
New Member
- Joined
- Feb 3, 2021
- Messages
- 31
- Office Version
- 2016
- Platform
- Windows
How would I turn this into looping through a list of email addresses contained in an excel worksheet? (same workbook)
How would I include the contents of a cell within the body of the email?
How would I include the contents of a cell within the body of the email?
VBA Code:
Public Sub CreateNewMessage()
Dim objMsg As MailItem
Dim Selection As Selection
Dim obj As Object
Set Selection = ActiveExplorer.Selection
For Each obj In Selection
Set objMsg = Application.CreateItem(olMailItem)
With objMsg
.To = obj.SenderEmailAddress
.Subject = "This is the subject"
.Categories = "Test"
.Body = "My notes" & vbcrlf & vbcrlf & obj.Body
.Display
' use .Send to send it automatically
End With
Set objMsg = Nothing
Next
End Sub