把VBA代码中的超链接用于自动发送电子邮件

我创build了一个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 

replace这个:

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

有了这个

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