如何从 Excel 发送电子邮件中的嵌入图像

2024-04-28

我想从 VB 发送电子邮件(Outlook)正文中的 Excel 图表(不是附件),有人知道该怎么做吗?

Solved:
只是为了在下面的回答中添加更多细节 您将需要以下内容(可以进行一些改进)。

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

and

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

经双方确认technet http://social.technet.microsoft.com/Forums/en/excel/thread/6fc76ceb-6642-4f71-ba41-b0b438d36de9 and mrexcel http://www.mrexcel.com/forum/showthread.php?t=562877

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何从 Excel 发送电子邮件中的嵌入图像 的相关文章

随机推荐