Mo-ra
New Member
- OS Version(s)
- Windows
- Outlook version
- Outlook 365 64 bit
- Email Account
- Office 365 Exchange
Operating system:: Windows 11
Outlook version: 365
Email type or host: Microsoft 365
Outlook version: 365
Email type or host: Microsoft 365
Any tips to get the following code to work on a new email template instead of creating a new email. Many thanks.
Code:
Sub OutgoingMsg()
Dim OApp As Object, OMail As Object, Signature As String
Dim strbody As String
Set OApp = CreateObject("Outlook.Application")
Set OMail = OApp.CreateItem(0)
With OMail
.Display
End With
Signature = OMail.HTMLBody
strbody = "<BODY style=font-size:12pt;font-family:Arial>Dear Customer,<p>Please find attached in respect of your enquiry.</BODY>"
With OMail
.HTMLBody = strbody & vbNewLine & Signature
'.Send
End With
Set OMail = Nothing
Set OApp = Nothing
End Sub