Pivot table pasting over signature

tommyboy2340

New Member
Joined
Oct 6, 2021
Messages
9
Office Version
  1. 365
Platform
  1. Windows
I have written this code which takes a screen shot of a pivot table and pastes it into an email. Everything works properly however when I send out the email, my signature is placed on top of the screenshot. My signature is generated through my work so I am not able to edit it. Is there any way to get my signature to appear below the screenshot?

VBA Code:
Sub send_email()

    Dim oLookApp As Outlook.Application
    Dim oLookItm As Outlook.MailItem
    Dim oLookIns As Outlook.Inspector
    
    Dim oWrdDoc As Word.Document
    Dim oWrdRng As Word.Range
    
    Dim PvtTbl As PivotTable
    Dim PvtRng As Range
    
    On Error Resume Next
    
    Set oLookApp = GetObject(, "Outlook.Application")
        If Err.Number = 429 Then
            Err.Clear
            Set oLookApp = New Outlook.Application
        End If
        
    Set PvtTbl = ThisWorkbook.Worksheets("2021 MWF Report").PivotTables("PivotTable1")
    
    Set PvtRng = PvtTbl.TableRange1
    Set oLookItm = oLookApp.CreateItem(olMailItem)
    
    
        
  With oLookItm
        .To = "John.Doe@place.com"
        
        .Subject = "Subject"
        .Body = "Good morning," & vbNewLine & vbNewLine & "The requested information for today can be seen below."
        
        Set oLookIns = .GetInspector
        Set oWrdDoc = oLookIns.WordEditor

        PvtRng.Copy
        Set oWrdRng = oWrdDoc.Application.ActiveDocument.Content
            oWrdRng.Collapse Direction:=wdCollapseEnd
        Set oWrdRng = oWrdDoc.Paragraph.Add
            oWrdRng.InsertBreak

        oWrdRng.PasteSpecial DataType:=wdPasteOLEObject, Link:=False
        

        .Display
        
    End With
    

End Sub
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

Forum statistics

Threads
1,212,927
Messages
6,110,731
Members
448,294
Latest member
jmjmjmjmjmjm

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top