只需链接到Excel发送的电子邮件中的URL即可

时间:2018-01-17 19:36:39

标签: excel-vba email url hyperlink vba

这看起来很简单。我正在使用宏从Excel发送电子邮件。在电子邮件正文中有一个网址。

示例:

有关编码的有用提示,请访问我们的网站:https:stackoverflow.com或访问https:google.com

我一直收到编译错误。我希望收到电子邮件的人能够点击该地址并链接到该网站。

由于

1 个答案:

答案 0 :(得分:1)

试试这个:

Email_Body = "Dear " & Name & "," & Chr(11) & _
    "Thank you for you question " & Chr(11) & _
    "We will get back to you within 24 hours." & _
    Chr(11) & "IMPORTANT: Please remember to " & _
    "you may find answers to your question on " & _
    "our website: forhelp.com. If you do not " & _
    "find a solution here." & Chr(11) & _
    "Please refer to Instructions available on the " & _
    "our intranet: developer.com/faq/.;" & Chr(11) & _
    "All listed answers are not perfect." & questions & Chr(11)

如果您仍有问题,请确保Name& questions是正确声明的变量。

另外,确保为Outlook对象分配了Email_Body。它应该看起来像:

With OutApp.CreateItem(0)
    .Email_Body = ...
End With

OutApp是引用您的Outlook应用程序/电子邮件的对象。