Incomplete embedded Image in Outlook through VBA

aayaanmayank

Board Regular
Joined
Jul 20, 2018
Messages
156
Hi Can someone help that why i am getting half of the when exporting image from excel through VBA.

below is my code
VBA Code:
Sub send1()
Dim sh1 As Worksheet
Set sh1 = ThisWorkbook.Sheets("sheet1")
Set sh = ThisWorkbook.Sheets("Template")
Dim OLOOK As Outlook.Application
Set OLOOK = New Outlook.Application
Dim omail As Outlook.MailItem
Set omail = OLOOK.CreateItem(olMailItem)

Dim ws As Worksheet
Set ws = ThisWorkbook.Sheets("Template")

Dim ch As ChartObjects
Sheets("DL").Activate
LR1 = Sheets("DL").Range("A" & Rows.Count).End(xlUp).Row + 1
LR2 = Sheets("DL").Range("A" & Rows.Count).End(xlUp).Row + 1

    Set emailRng = Worksheets("DL").Range("A2:A" & LR1)
    Set emailRng1 = Worksheets("DL").Range("B2:B" & LR2)
    For Each cl In emailRng
        sTo = sTo & ";" & cl.Value
    Next
    For Each cl1 In emailRng1
        sTo1 = sTo1 & ";" & cl1.Value
    Next
    tmp = Environ("USERPROFILE") & "\Desktop\" & "Mypic.Bmp"
     sTo = Mid(sTo, 2)
     sTo1 = Mid(sTo1, 2)
     
With omail
    
omail.To = sTo
omail.CC = sTo1
omail.Subject = Sheets("DL").Range("C2").Value
omail.HTMLBody = "<BR> " & " <style=border: none>" & _
"<table align=""center"">" & _
"<img src = '" & tmp & "' >"
omail.Display

End With

sh1.Pictures.Delete
sh.Activate
End Sub
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
68,159
Office Version
  1. 365
Platform
  1. Windows
Cross posted
While we do allow Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules). This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.


Please supply all relevant links.
 

aayaanmayank

Board Regular
Joined
Jul 20, 2018
Messages
156
Well
Cross posted
While we do allow Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules). This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.


Please supply all relevant links.
Well i have spent almost a week to find out the solution on this. but have not found anywhere on this site which is linked to my question. pls advise if there is any.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
68,159
Office Version
  1. 365
Platform
  1. Windows
You have asked this question on at least one other site, that is known as cross posting.
Please supply links to all other sites where you have asked this question.
 
Joined
Feb 8, 2002
Messages
3,105
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

Hello aayaanmayank - thanks for answering my request for the code by posting this code here. I am going to run this past the testers on the Excel team.
Fluff - Sorry for the cross-posting. I asked him to post here so I could get the full code.
 

aayaanmayank

Board Regular
Joined
Jul 20, 2018
Messages
156
Hello aayaanmayank - thanks for answering my request for the code by posting this code here. I am going to run this past the testers on the Excel team.
Fluff - Sorry for the cross-posting. I asked him to post here so I could get the full code.
Np. I really need help on this.
Please let me know if you need complete code. from Convert text boxes and shapes to image, then save to folder, and import to outlook.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,236
Messages
5,768,955
Members
425,506
Latest member
AndreaWorkPlace

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
Top