Thank you in advance for your help!
I have had this set up to ask for the row and then use that to find the range to insert into the email. I am working on adding to it so that it will pull my signature to insert. I have found that I need to use HTMLBody in order to have my signature appear correctly. Otherwise, it pulls in all the saved HTML code.
But, when I use HTMLBody I lose all my formatting in the range I am pulling in. Since I am going to use this over quite a few other emails and the body range is quite the concatenate I'd prefer not to have to create that in HTML. Here is the code with the original Body Range and the changed one below.
Sub OfferApproval2()
On Error GoTo PROC_EXIT
'DECLARE AND SET VARIABLES
Dim Signature As String
Set otlApp = CreateObject("Outlook.<wbr>Application")
Set OtlNewMail = otlApp.CreateItem(olMailItem)
'-----------------------------<wbr>------------
'GET DEFAULT EMAIL SIGNATURE
Signature = Environ("appdata") & "\Microsoft\Signatures"
If Dir(Signature, vbDirectory) <> vbNullString Then
Signature = Signature & Dir$(Signature & "Signature.htm")
Else:
Signature = ""
End If
Signature = CreateObject("Scripting.<wbr>FileSystemObject").GetFile(<wbr>Signature).OpenAsTextStream.<wbr>ReadAll
'-----------------------------<wbr>------------
'CREATE EMAIL
OtlNewMail.HTMLBody = Signature
With OtlNewMail
Rw = InputBox("What row number?")
If Rw = "" Then Exit Sub 'user clicked cancel
.To = Range("FU" & Rw).Text
.Subject = Range("FS" & Rw).Text
.Body = Range("FT" & Rw).Text & Signature
.Display
'.Send
End With
'-----------------------------<wbr>------------
'CLEANUP
Set OtlNewMail = Nothing
Set otlApp = Nothing
Set otlAttach = Nothing
Set otlMess = Nothing
Set otlNSpace = Nothing
PROC_EXIT:
On Error GoTo 0
Set OL = Nothing
End Sub
HTML Body
.HTMLBody = "<p><font face = ""arial""> This is where I was entering the range info </HTML> $ Signature
I have had this set up to ask for the row and then use that to find the range to insert into the email. I am working on adding to it so that it will pull my signature to insert. I have found that I need to use HTMLBody in order to have my signature appear correctly. Otherwise, it pulls in all the saved HTML code.
But, when I use HTMLBody I lose all my formatting in the range I am pulling in. Since I am going to use this over quite a few other emails and the body range is quite the concatenate I'd prefer not to have to create that in HTML. Here is the code with the original Body Range and the changed one below.
Sub OfferApproval2()
On Error GoTo PROC_EXIT
'DECLARE AND SET VARIABLES
Dim Signature As String
Set otlApp = CreateObject("Outlook.<wbr>Application")
Set OtlNewMail = otlApp.CreateItem(olMailItem)
'-----------------------------<wbr>------------
'GET DEFAULT EMAIL SIGNATURE
Signature = Environ("appdata") & "\Microsoft\Signatures"
If Dir(Signature, vbDirectory) <> vbNullString Then
Signature = Signature & Dir$(Signature & "Signature.htm")
Else:
Signature = ""
End If
Signature = CreateObject("Scripting.<wbr>FileSystemObject").GetFile(<wbr>Signature).OpenAsTextStream.<wbr>ReadAll
'-----------------------------<wbr>------------
'CREATE EMAIL
OtlNewMail.HTMLBody = Signature
With OtlNewMail
Rw = InputBox("What row number?")
If Rw = "" Then Exit Sub 'user clicked cancel
.To = Range("FU" & Rw).Text
.Subject = Range("FS" & Rw).Text
.Body = Range("FT" & Rw).Text & Signature
.Display
'.Send
End With
'-----------------------------<wbr>------------
'CLEANUP
Set OtlNewMail = Nothing
Set otlApp = Nothing
Set otlAttach = Nothing
Set otlMess = Nothing
Set otlNSpace = Nothing
PROC_EXIT:
On Error GoTo 0
Set OL = Nothing
End Sub
HTML Body
.HTMLBody = "<p><font face = ""arial""> This is where I was entering the range info </HTML> $ Signature