Incomplete embedded Image in Outlook through VBA

aayaanmayank

Board Regular
Joined
Jul 20, 2018
Messages
157
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

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
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.
 
Upvote 0
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.
 
Upvote 0
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.
 
Upvote 0
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.
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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