Greetings
I have below code open Outlook from Excel, pull an email address to BCC field, subject and some contents. What changes are required to pull multiple emails from cells B12:B18, B21:22, B29, B32 and B35 to the BCC field?
Also, is it possible to pull across a Richtext formatted email I have in the excel sheet, either in a range of cells or a single cell?
Your help is most appreciated
I have below code open Outlook from Excel, pull an email address to BCC field, subject and some contents. What changes are required to pull multiple emails from cells B12:B18, B21:22, B29, B32 and B35 to the BCC field?
Also, is it possible to pull across a Richtext formatted email I have in the excel sheet, either in a range of cells or a single cell?
Your help is most appreciated
Code:
Sub email() Dim a As Integer
Dim objOutlook As Object
Dim objMail As Object
Dim rngTo As Range
Dim rngSubject As Range
Dim rngBody As Range
Dim rngAttach As Range
Set objOutlook = CreateObject("Outlook.Application")
Set objMail = objOutlook.CreateItem(0)
a = ActiveCell.Row
With ActiveSheet
Set rngTo = Range("B29")
Set rngSubject = Worksheets("Admin").Range("B3")
Set rngBody = Worksheets("Admin").Range("B6")
End With
With objMail
.Bcc = rngTo.Value
.Subject = rngSubject.Value
.Body = rngBody.Value
.Display
End With
Set objOutlook = Nothing
Set objMail = Nothing
Set rngTo = Nothing
Set rngSubject = Nothing
Set rngBody = Nothing
Set rngAttach = Nothing
End Sub