Copy pasting data from Excel to Outlook

Pranesh

Board Regular
Joined
Jun 29, 2014
Messages
219
Hi All,

I have a data in excel sheet which I would like to send as email body. In my sheet I have few lines of text few charts, shapes and Pics. Im currently using a code which will copy paste the data to an email. But in that draft email if I scroll down to view the email body the shapes in the email is disappearing. If I scroll up and slowly move it down and when shapes is about to come again it disappears. I have no clue on the issue here. Can someone help me pls.

Below is the code which I use.

Code:
Sub India_BB()
    Dim i As Integer
    Dim ShtToSend As Worksheet
    Dim strSendTo, strbody As String
    Dim strSheetName As String
    Dim strSubject As String
    Dim Hlink As Hyperlink
    Dim rng As Range
    ' add ref - tool -> references - > Microsoft Word XX.X Object Library
    Dim wdDoc As Word.Document '<=========

    Set Mail_Object = CreateObject("Outlook.Application")
    Set Mail_Single = Mail_Object.CreateItem(0)
    Set wdDoc = Mail_Single.GetInspector.WordEditor '<========

    For i = 1 To ThisWorkbook.Sheets.Count
        If Sheets(i).Name = "Sheet3" Then
            Sheets(i).Select
            Set rng = Nothing
            strSheetName = Sheets(i).Name
            strSendTo = Sheet1.Range("A1").Text
            strSubject = Sheet1.Range("B1").Text
            Set rng = Sheets(strSheetName).Range("A1:R67").SpecialCells(xlCellTypeVisible)
                rng.Copy
             
  
            With Mail_Single
                .To = strSendTo
                .CC = ""
                .BCC = ""
                .Subject = strSubject
'               .HTMLBody = RangetoHTML(rng)
                .Display
                 wdDoc.Range.PasteAndFormat wdChartPicture & .HTMLBody = " " '<=======
            End With
        End If
    Next i
End Sub
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Forum statistics

Threads
1,224,823
Messages
6,181,171
Members
453,021
Latest member
Justyna P

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