Vincent88
Active Member
- Joined
- Mar 5, 2021
- Messages
- 382
- Office Version
- 2019
- Platform
- Windows
- Mobile
I want to copy a cell and range data from Excel to a Outlook template .msg file. Copy a cell value to SUBJECT of template and range value to template content. I manage to get below VBA but I do not know how to paste them to the position I prefer. Kindly advise.?
Sub CopyToEmailTemp()
If ActiveWorkbook Is ThisWorkbook Then
Dim ws As Worksheet
Set ws = Sheet7
ws.Cell("e5").Copy
wx.Range("e7:e15").Copy
Dim myoutapp As Object
Dim myitem As Object
Set myoutapp = CreateObject("Outlook.Application")
Set myitem = myoutapp.CreateItemFromTemplate("C:\Users\vincent\Desktop\MrExcel.msg")
myitem.Display
End If
End Sub
Sub CopyToEmailTemp()
If ActiveWorkbook Is ThisWorkbook Then
Dim ws As Worksheet
Set ws = Sheet7
ws.Cell("e5").Copy
wx.Range("e7:e15").Copy
Dim myoutapp As Object
Dim myitem As Object
Set myoutapp = CreateObject("Outlook.Application")
Set myitem = myoutapp.CreateItemFromTemplate("C:\Users\vincent\Desktop\MrExcel.msg")
myitem.Display
End If
End Sub