将附件图片添加到Office 16/O365中的html电子邮件正文中 [英] add attachment picture into html email body in office 16 / O365

查看:311
本文介绍了将附件图片添加到Office 16/O365中的html电子邮件正文中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在Office 2013中使用此代码:

I have been using this code in office 2013:

With OutMail
            .Attachments.Add fName
            .HTMLBody = .HTMLBody & "<br><B>" & ChartName &   :</B><br>" _ & "<img src='" & fName(i) & "' width='800'  height='400'><br>" _

            .Display
        End With

其中fName是png文件的完整路径,而Chartname只是图形的标题.

where fName is full path to png file and Chartname is just a headline for the graph.

这一直很好,但是现在在Office 2016/O365中,此代码将一个空的html表粘贴到外环电子邮件中,并且看不到任何图形或图片. 任何指示如何解决此问题的指针将不胜感激?

This has always worked fine but now in office 2016 / O365 this code pastes an empty html table into the outloop email and no graph or picture is visible. Any pointers how to fix this would be appreciated?

推荐答案

.HTMLBody行上存在错误.尝试以下方法:

There are errors on your .HTMLBody line. Try this instead:

.HTMLBody = .HTMLBody & "<br><B>" & ChartName & ":</B><br>" & "<img src='" & 
fName(i) & "' width='800'  height='400'><br>"

我添加了引号,并删除了不需要的_.

I added a quote and removed unneeded _.

这篇关于将附件图片添加到Office 16/O365中的html电子邮件正文中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆