G
gary
i have the following code set up to e-mail, i want to have multiple addresses
in the BCCfield. how do i do that?
Sub Mail_Sheet_Outlook_Body()
Dim rng As Range
Dim OutApp As Object
Dim OutMail As Object
With Application
.EnableEvents = False
.ScreenUpdating = False
End With
Set rng = Nothing
Set rng = ActiveSheet.UsedRange
'You can also use a sheet name
'Set rng = Sheets("Lead Sheet").UsedRange
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.to = Format(Worksheets("Lead Sheet").Range("D32").Value, "mm-dd")
.CC = Format(Worksheets("Lead Sheet").Range("D33").Value, "mm-dd")
.BCC = Format(Worksheets("Lead Sheet").Range("D34").Value, "mm-dd")
.Subject = Format(Worksheets("Lead Sheet").Range("F9").Value, "mm-dd")
.HTMLBody = Format(Worksheets("Lead Sheet").Range("A135").Select,
Application.CutCopyMode = False, Selection.Copy, "mm-dd")
Application.SendKeys "^v"
.Display
End With
On Error GoTo 0
With Application
.EnableEvents = True
.ScreenUpdating = True
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
in the BCCfield. how do i do that?
Sub Mail_Sheet_Outlook_Body()
Dim rng As Range
Dim OutApp As Object
Dim OutMail As Object
With Application
.EnableEvents = False
.ScreenUpdating = False
End With
Set rng = Nothing
Set rng = ActiveSheet.UsedRange
'You can also use a sheet name
'Set rng = Sheets("Lead Sheet").UsedRange
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.to = Format(Worksheets("Lead Sheet").Range("D32").Value, "mm-dd")
.CC = Format(Worksheets("Lead Sheet").Range("D33").Value, "mm-dd")
.BCC = Format(Worksheets("Lead Sheet").Range("D34").Value, "mm-dd")
.Subject = Format(Worksheets("Lead Sheet").Range("F9").Value, "mm-dd")
.HTMLBody = Format(Worksheets("Lead Sheet").Range("A135").Select,
Application.CutCopyMode = False, Selection.Copy, "mm-dd")
Application.SendKeys "^v"
.Display
End With
On Error GoTo 0
With Application
.EnableEvents = True
.ScreenUpdating = True
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub