繁体   English   中英

将超链接放入VBA代码中以自动发送电子邮件

[英]Put Hyperlink inside VBA Code for automatic emails

我创建了一个自动发送电子邮件的VBA代码。 在那封电子邮件中,我想要一个超链接,该超链接链接到我上传文件的网页。

我遇到的麻烦是在VBA代码中放入了HTML超链接标记。

查看我的代码:

msgbody = "Hi Everyone" & "<br> <br>" _
& "I have attached the excel file to this afternoon's Open Order Report above, as well as provided the link below:" & "<br> <br>" _
& "Please reach out if you have any more questions or concerns" & "<br>"
& "<a href= & "www.google.com">" & "link" </a>"

With objemail
    .to = "spall@.its.jnj.com"
    .cc = ""
    .Subject = "test"
    .htmlbody = msgbody
    .display
End With

End Sub

替换为:

& "<a href= & "www.google.com">" & "link" </a>"

有了这个

& "<a href=" & """" & "www.google.com" & """" & ">" & "link" </a>"

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM