Hacktastic
Technical User
Greetings,
I have a macro set up to run a series of emails, and I would like to pass into that macro a specific range from excel and place it into the body of the outlook email.
I looked online and it says i have to pass it as an HTML using a worddocument editor.
I am quite confused.
Some sample code below
Sub putinEmail()
Dim objOutlook As Outlook.Application
Dim objOutlookExp As Object
Dim objDrafts As Object
Dim objEmail As Object
Dim strBody, strTitle, strTo As String
Dim MyData As Object
Dim Doc As Word.Document
Dim wdRn As Word.Range
Dim Xl As Excel.Application
Dim Ws As Excel.Worksheet
Dim xlRn As Excel.Range
Dim newtab As Table
'Set wdRn = Doc.Range
Set Xl = GetObject(, "Excel.Application")
Sheets("pName").Select
Set Ws = Xl.Workbooks("Media Spend TPS vb.xlsm").Worksheets(1)
Set xlRn = Ws.Range("A16", "f100")
xlRn.Copy
I want to pass xlRn into another macro as an html
so that its like
Sendemail1 (xlRn)
any way on how to do this?
I have a macro set up to run a series of emails, and I would like to pass into that macro a specific range from excel and place it into the body of the outlook email.
I looked online and it says i have to pass it as an HTML using a worddocument editor.
I am quite confused.
Some sample code below
Sub putinEmail()
Dim objOutlook As Outlook.Application
Dim objOutlookExp As Object
Dim objDrafts As Object
Dim objEmail As Object
Dim strBody, strTitle, strTo As String
Dim MyData As Object
Dim Doc As Word.Document
Dim wdRn As Word.Range
Dim Xl As Excel.Application
Dim Ws As Excel.Worksheet
Dim xlRn As Excel.Range
Dim newtab As Table
'Set wdRn = Doc.Range
Set Xl = GetObject(, "Excel.Application")
Sheets("pName").Select
Set Ws = Xl.Workbooks("Media Spend TPS vb.xlsm").Worksheets(1)
Set xlRn = Ws.Range("A16", "f100")
xlRn.Copy
I want to pass xlRn into another macro as an html
so that its like
Sendemail1 (xlRn)
any way on how to do this?