如何从Excel发送电子邮件中的嵌入式图像 [英] How to send an embedded image in email from excel
本文介绍了如何从Excel发送电子邮件中的嵌入式图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在VB的电子邮件(Outlook)(不是附件)的正文中发送Excel图表,有人知道该怎么做吗?
I would like to send a Excel chart in the body of an email (Outlook) (not as attachment) from VB, anyone know how to do this?
已解决:
只是为了在下面添加更多细节来回答
您将需要以下内容(可以做一些改进).
Solved:
Just to add a bit more detail to answer below
you'll need the following (could do with some improvement).
Sheets(2).ChartObjects(1).Chart.Export "C:\temp\Chart2.png"
....
.HTMLBody = "<html xmlns:o='urn:schemas-microsoft-com:office:office'" & _
"xmlns: x = 'urn:schemas-microsoft-com:office:excel'" & _
"xmlns='http://www.w3.org/TR/REC-html40'> " & _
"<head></head><body><img src='Chart2.png'></body></html>"
和
.Attachments.Add ("C:\temp\Chart2.png")
推荐答案
似乎最好的方法是导出图表:
Sheets(1).ChartObjects("Chart 1").Chart.Export "C:\Chart1.png"
然后将图像添加到您的邮件 HTML正文:
.HTMLBody = .HTMLBody & "< img src='c:\folder\filename.png'>"
这篇关于如何从Excel发送电子邮件中的嵌入式图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文