gpt4 book ai didi

VBA 在电子邮件正文中插入链接而不使用 HTML 正文?

转载 作者:行者123 更新时间:2023-12-04 20:11:38 27 4
gpt4 key购买 nike

我想在通过 excel VBA 创建的电子邮件正文中插入一个链接。链接每天都在变化,所以我把它的值放在单元格 B4 中。但是,我找不到正确的方法来发送带有该链接的电子邮件。

这是我正在使用的代码:

Public Sub email_missing_forecast()

Application.ScreenUpdating = False

'Déclaration des variables

derniereligne = Range("B5000").End(xlUp).Row
Project_number = Cells(1, 2).Value
Project_name = Cells(2, 2).Value
Project_due = Cells(3, 2).Value
Link = Cells(4, 2).Value

Dim Objoutlook As New Outlook.Application
Dim Objectmail

'Condition

For i = 6 To derniereligne

Adresse = Cells(i, "D").Value
Adresse2 = Cells(i, "E").Value
Adresse3 = Cells(i, "F").Value

If Cells(i, "B").Value = "No" Then
Set Objoutlook = New Outlook.Application
Set Objectmail = Outlook.createitem(olmailitem)

With Objectmail
.To = Adresse & ";" & Adresse2 & ";" & Adresse3
.Subject = "Bobbi Brown | " & Project_number & " " & Project_name & " | Forecast due " & Project_due
.Body = "Dear All, " & Chr(10) & Chr(10) & "I kindly remind you that forecasts for program " & Project_number & " " & Project_name & " are due " & Project_due & "." & Chr(10) & Chr(10) & "Please enter your forecast at this link below." & Chr(10) & Chr(10) & Link & Chr(10) & Chr(10) & "Best Regards," & Chr(10) & "Christian Chen"
.Send

End With
End If
Next i

Application.ScreenUpdating = True

MsgBox "Your e-mails have been sent successfully", , "FIY"
End Sub

最佳答案

恕我直言,只有两种可能性:

  • the plain text Email: NO clickable link is possible
  • the HTML Email: clickable link is possible, well-formed HTML WITH <body> Tag is necessary!

关于VBA 在电子邮件正文中插入链接而不使用 HTML 正文?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40465789/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com