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.
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