[FONT="]Hello everyone,[/FONT]
[FONT="]I have this VBA code which works great, I am trying to include rage selection. So in order words I want it work like the Sub send selection code. How to I incorporate the sub selection code with the below code.[/FONT]
[FONT="]Sub Send_Email_With_Signature()
[/FONT]
[FONT="]Dim objOutApp As Object, objOutMail As Object[/FONT]
[FONT="]Dim strBody As String, strSig As String[/FONT]
[FONT="]Set objOutApp = CreateObject("Outlook.Application")[/FONT]
[FONT="]Set objOutMail = objOutApp.CreateItem(0)[/FONT]
[FONT="]On Error Resume Next[/FONT]
[FONT="]
[/FONT]
[FONT="]With objOutMail[/FONT]
[FONT="]'SET THE EMAIL CONDITIONS[/FONT]
[FONT="].To = "rick@morty@ctr"[/FONT]
[FONT="].CC = ""[/FONT]
[FONT="].BCC = ""[/FONT]
[FONT="].Subject = "Subject Line"[/FONT]
[FONT="]'ADD ATTACHMENTS[/FONT]
[FONT="]'.Attachments.Add ("C:\Users\FormatCells\Documents\MyTestDoc.txt")[/FONT]
[FONT="]'IF SENT FROM ANOTHER EMAIL ACCOUNT (MUST ALREADY BE SETUP)[/FONT]
[FONT="]'.SentOnBehalfOfName = "AnotherAccount@FormatCells.com"[/FONT]
[FONT="]'CHECK NAMES, ENSURES INTERNAL EMAIL ADDRESSES EXISTS IN ADDRESS BOOK[/FONT]
[FONT="].Recipients.ResolveAll[/FONT]
[FONT="]'DO NOT REMOVE - THIS MUST BE VISIBLE FIRST TO GET THE DEFAULT SIGNATURE[/FONT]
[FONT="].Display[/FONT]
[FONT="]'GET THE HTML CODE FROM THE SIGNATURE[/FONT]
[FONT="]strSig = .Htmlbody[/FONT]
[FONT="]'WHAT SHOULD THE EMAIL SAY, ON TOP OF THE SIGNATURE[/FONT]
[FONT="]'HTML TAGS CAN BE INCLUDED HERE[/FONT]
[FONT="].strBody = "Sendrng = Selection"[/FONT]
[FONT="]'COMBINE THE EMAIL WITH THE SIGNATURE[/FONT]
[FONT="].Htmlbody = strBody & strSig[/FONT]
[FONT="]'IF YOU DO NOT HAVE HTML IN THE BODY, USE THIS INSTEAD[/FONT]
[FONT="]'.Body = strBody & strSig[/FONT]
[FONT="]'AUTOMATICALLY SEND EMAIL (IT WILL STILL BRIEFLY POPUP)[/FONT]
[FONT="]'.Send[/FONT]
[FONT="]End With[/FONT]
[FONT="]On Error GoTo 0[/FONT]
[FONT="]Set objOutMail = Nothing[/FONT]
[FONT="]Set objOutApp = Nothing[/FONT]
[FONT="]
[/FONT]
[FONT="]End Sub[/FONT]
[FONT="]I have this VBA code which works great, I am trying to include rage selection. So in order words I want it work like the Sub send selection code. How to I incorporate the sub selection code with the below code.[/FONT]
[FONT="]Sub Send_Email_With_Signature()
[/FONT]
[FONT="]Dim objOutApp As Object, objOutMail As Object[/FONT]
[FONT="]Dim strBody As String, strSig As String[/FONT]
[FONT="]Set objOutApp = CreateObject("Outlook.Application")[/FONT]
[FONT="]Set objOutMail = objOutApp.CreateItem(0)[/FONT]
[FONT="]On Error Resume Next[/FONT]
[FONT="]
[/FONT]
[FONT="]With objOutMail[/FONT]
[FONT="]'SET THE EMAIL CONDITIONS[/FONT]
[FONT="].To = "rick@morty@ctr"[/FONT]
[FONT="].CC = ""[/FONT]
[FONT="].BCC = ""[/FONT]
[FONT="].Subject = "Subject Line"[/FONT]
[FONT="]'ADD ATTACHMENTS[/FONT]
[FONT="]'.Attachments.Add ("C:\Users\FormatCells\Documents\MyTestDoc.txt")[/FONT]
[FONT="]'IF SENT FROM ANOTHER EMAIL ACCOUNT (MUST ALREADY BE SETUP)[/FONT]
[FONT="]'.SentOnBehalfOfName = "AnotherAccount@FormatCells.com"[/FONT]
[FONT="]'CHECK NAMES, ENSURES INTERNAL EMAIL ADDRESSES EXISTS IN ADDRESS BOOK[/FONT]
[FONT="].Recipients.ResolveAll[/FONT]
[FONT="]'DO NOT REMOVE - THIS MUST BE VISIBLE FIRST TO GET THE DEFAULT SIGNATURE[/FONT]
[FONT="].Display[/FONT]
[FONT="]'GET THE HTML CODE FROM THE SIGNATURE[/FONT]
[FONT="]strSig = .Htmlbody[/FONT]
[FONT="]'WHAT SHOULD THE EMAIL SAY, ON TOP OF THE SIGNATURE[/FONT]
[FONT="]'HTML TAGS CAN BE INCLUDED HERE[/FONT]
[FONT="].strBody = "Sendrng = Selection"[/FONT]
[FONT="]'COMBINE THE EMAIL WITH THE SIGNATURE[/FONT]
[FONT="].Htmlbody = strBody & strSig[/FONT]
[FONT="]'IF YOU DO NOT HAVE HTML IN THE BODY, USE THIS INSTEAD[/FONT]
[FONT="]'.Body = strBody & strSig[/FONT]
[FONT="]'AUTOMATICALLY SEND EMAIL (IT WILL STILL BRIEFLY POPUP)[/FONT]
[FONT="]'.Send[/FONT]
[FONT="]End With[/FONT]
[FONT="]On Error GoTo 0[/FONT]
[FONT="]Set objOutMail = Nothing[/FONT]
[FONT="]Set objOutApp = Nothing[/FONT]
[FONT="]
[/FONT]
[FONT="]End Sub[/FONT]