如何在 Excel 宏生成的电子邮件中发送非 http 超链接?

How do I send a non-http hyperlink in an email message generated by Excel macros?

我正在使用 Excel 宏发送电子邮件,内容保存在单元格中。我需要发送一个看起来像这样的非 http link

elodms:// 后跟 ID

我假设 outlook 不知道 link 的这种形式,并且在发送电子邮件时它不会将其显示为可点击的 link,就像插入电子邮件时一样地址。

是否可以强制 outlook 将其视为 hyperlink?是否可以通过 VBA Excel 宏来完成?

这就是我以前在 Excel 中处理电子邮件的方式。

Email = "Hello, <br><br>" & _
                "this is something:" & _
                   "<br><br> Thank you." & _
                   "<br><br><br> <a href='elodms://12345'>CLICK HERE</a>"
    With OutMail
        .To = "you@me.com"
        .CC = ""
        .BCC = ""
        .Subject = "SUBJECT"
        .HTMLBody = Email

        .send
    End With

Is it possible to force outlook to view it as a hyperlink?

您可以使用 MailItem class 的 HTMLBody 属性。看起来您只需要将超链接插入正文即可。要使其正常工作,您需要找到标签并在结束标签之前的任意位置插入以下字符串:

 <a href="elodms:// followed by an ID">link text goes here</a>

And can it be done through VBA Excel macros?

是的,可以从 Excel 开始。参见 How to automate Outlook from another program