Hey LJMetzger,
Thanks for that response. As I said, im really new to this. I think ive followed the instructions, but i'm getting a type mismatch error now. When I step in to it, it seems to be in my email body. Basically the part I did lol
Sub OutlookEmailHTMLBodyConvertedAddSignature()
'This assumes that Outlook is already open to simplify the code
'
'The 'Font Name' and 'Font Size' attributes are variables obtained from the Spreadsheet
Dim OutApp As Object
Dim OutMail As Object
Dim var As Variant: var = Selection.Value
Dim sBody As String
Dim sFontName As String
Dim sFontSize As String
'Set the Font Name and Font Size
sFontName = "Arial"
sFontSize = "13"
'Get the Email Body from the cell
sBody = "Dear" & " " & var(1, 9) & " " & var(1, 7) & vbCrLf & "We wanted to let you know that your artwork titled " & var(1, 5) & " is ready to be dispatched. " & vbCrLf & "Please email us or call " & var(1, 25) & " on ******* ext. " & var(1, 26) & " and quote " & var(1, 3) & " at your earliest convenience to arrange a suitable week day (Monday-Friday), giving at least 48 hours notice, for your item to be delivered." & vbCrLf & "Kind Regards" & var(1, 12) 'Creates text body
'Replace ASCII NEW LINE with HTML NEW LINE
sBody = Replace(sBody, vbCrLf, "<BR>") 'Converts text body to HTML
sBody = Replace(sBody, vbLf, "<BR>")
sBody = Replace(sBody, vbCr, "<BR>")
'Attempt to create an Outlook object
On Error Resume Next
Set OutApp = GetObject(, "Outlook.Application")
If Err.Number <> 0 Then
Err.Clear
MsgBox "NOTHING DONE. The Outlook Object could not be created from Excel." & vbCrLf & _
"Try again when Outlook is open."
Exit Sub
End If
On Error GoTo 0
'Create the Outlook Mail Object (using the default Email account)
Set OutMail = OutApp.CreateItem(0)
'Grab the Signature
OutMail.Display 'Creates .HTMLbody containing the signature
'Determine the values to be sent
With OutMail
.To = var(1, 6)
.CC = ""
.BCC = ""
.Subject = "Dispatch"
'Put New .HTMLbody (containing font information) around sBody (HTML body) and in front of the signature .HTMLBody
.HTMLBody = "<p style='font-family:" & Arial & ";13:" & sFontSize & "pt'>" & sBody & "</p>" & .HTMLBody
.Display
'.Send - comment out the 'Display line' if you want to send
End With
'Clear the Object Pointers
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
By the way, the stars are the phone number for my place. It is an actual number.
Bookmarks