Excel 在自动电子邮件的VBA代码中放置超链接

Excel 在自动电子邮件的VBA代码中放置超链接,excel,hyperlink,vba,Excel,Hyperlink,Vba,我创建了一个VBA代码,它在其中自动发送电子邮件。在那封电子邮件中,我想有一个超链接,链接到我上传文件的网页 我遇到的麻烦是将HTML超链接标记放在VBA代码中 查看我的代码: msgbody = "Hi Everyone" & "<br> <br>" _ & "I have attached the excel file to this afternoon's Open Order Report above, as well as provided th

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

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

查看我的代码:

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
msgbody=“大家好”和“

”_ &我已将excel文件附加到今天下午的上述未结订单报告中,并提供了以下链接:&“

”_ &“如果您还有任何问题或顾虑,请联系”&“
” & "" 用电子邮件 .to=”spall@.its.jnj.com" .cc=“” .Subject=“测试” .htmlbody=msgbody .展示 以 端接头
替换此:

& "<a href= & "www.google.com">" & "link" </a>"
&“
用这个

& "<a href=" & """" & "www.google.com" & """" & ">" & "link" </a>"
&“
替换此:

& "<a href= & "www.google.com">" & "link" </a>"
&“
用这个

& "<a href=" & """" & "www.google.com" & """" & ">" & "link" </a>"
&“
请参见此处的可能副本请参见此处的可能副本