Eric Penfold
Active Member
- Joined
- Nov 19, 2021
- Messages
- 431
- Office Version
- 365
- Platform
- Windows
- Mobile
Trying to paste a shape into an email with hyperlink in the shape.
Also make sure the shape stay`s where it is on the excel sheet.
Also make sure the shape stay`s where it is on the excel sheet.
VBA Code:
ws.Shapes.Range(Array("Brainstorm Suggestions")).Select
With Selection
.Paste
End with
VBA Code:
Option Explicit
Sub SendDailyMailEmail()
Dim wb As Workbook
Dim ws As Worksheet
Dim tbl As Range
Dim LRow As Long
Dim EmailApp As Object, EmailItem As Object
Dim Pic As Picture
Dim MyShp As Shape
Dim WordDoc
Set EmailApp = CreateObject("Outlook.Application")
Set EmailItem = EmailApp.CreateItem(0)
Set wb = Workbooks("MyPersonal.xlsb")
Set ws = wb.Sheets("DailyMail")
LRow = ws.Cells(Rows.Count, 1).End(xlUp).Row
Set tbl = ws.Range("A1:Q" & LRow)
ws.Activate
tbl.Copy
Set Pic = ws.Pictures.Paste
Pic.Select
Pic.Cut
With EmailItem
.To = ""
.Subject = "Daily Mail" & " " & Format(Date, "dd-mm-yy")
.Display
Set WordDoc = EmailItem.GetInspector.WordEditor
With WordDoc.Range
.PasteAndFormat 13
ws.Shapes.Range(Array("Brainstorm Suggestions")).Select
With Selection
.Paste
End With
.InsertParagraphafter
.InsertParagraphafter
.InsertAfter "Kind Regards,"
End With
End With
On Error GoTo 0
Set EmailItem = Nothing
Set EmailApp = Nothing
End Sub