Roderick_E
Well-known Member
- Joined
- Oct 13, 2007
- Messages
- 2,051
Why is it that this code will show the signature ONLY if I enable .display? I'd like to just .send without .display.
TECH:
This loops through rows 2-3 and creates an Outlook mail object, to which it adds to,cc,bbc,subject,body and then emails
TECH:
This loops through rows 2-3 and creates an Outlook mail object, to which it adds to,cc,bbc,subject,body and then emails
Code:
Sub Mail_Outlook_With_Signature_Html_1()
' Working in Office 2000-2016
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
For x = 2 To 3
tostr = Sheet1.Cells(x, "a")
ccopy = Sheet1.Cells(x, "b")
bcopy = Sheet1.Cells(x, "c")
substr = Sheet1.Cells(x, "d")
strbody = Sheet1.Cells(x, "e")
'On Error Resume Next
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.Display
.to = tostr
.CC = ccopy
.BCC = bcopy
.Subject = substr
.HTMLBody = strbody & "<br>" & .HTMLBody
.Send
End With
'On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
Next x
MsgBox "test"
End Sub