【问题标题】:Copy-Paste hyperlinks from Excel to Outlook but display custom text将超链接从 Excel 复制粘贴到 Outlook,但显示自定义文本
【发布时间】:2021-11-09 14:23:41
【问题描述】:

我使用 VBA 将数据透视表从 Excel 复制粘贴到 Outlook。其中一列是指向某些页面的链接。

我想使用“单击此处”和超链接(而不是共享长链接)对其进行自定义。

【问题讨论】:

    标签: excel vba outlook hyperlink copy


    【解决方案1】:

    阿尔伯!

    如果您在构建 Outlook 中使用 HTMLBody,您只需添加一个“A”标签。

    Sub Send_Email()

    Dim OutApp As Object
    Dim OutMail As Object
    
    Set OutApp = CreateObject("Outlook.Application")
    Set OutMail = OutApp.CreateItem(olMailItem)
    
    strHTML = "<a href='http://www.google.com.br'>Click Here</a>"
    
    With OutMail
        .To = "destinatario@gmail.com"
        .CC = "copiado@gmail.com"
        .BCC = "somentesenecessario@gmail.com"
        .HTMLBody = strHTML
        .Subject = "Test e-mail"
        .Display
    End With
    
    Set OutApp = Nothing
    Set OutMail = Nothing
    

    结束子

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-03-02
      • 1970-01-01
      相关资源
      最近更新 更多