【发布时间】:2019-01-08 23:24:21
【问题描述】:
我在嵌入指向 this 等文本的超链接时遇到问题。
我正在从 Excel 运行宏,该宏创建一个 Outlook 对象并重复 c 列下的所有值。
以下不起作用,如何在此处嵌入链接?
.Body = "Click Here <https://www.google.com/>
代码如下
Dim OutApp As Object
Dim OutMail As Object
Dim cell As Range
Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")
On Error GoTo cleanup
For Each cell In Columns("B").Cells.SpecialCells(xlCellTypeConstants)
If cell.Value Like "?*@?*.?*" And _
LCase(Cells(cell.Row, "C").Value) = "yes" Then
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.SentOnBehalfOfName = "urdearboy@needshelp.com"
.to = cell.Value
.Subject = "Subject" & Cells(cell.Row, "D").Value
.Body = "Click Here <https://www.google.com/>"
strLocation = "C:\Users\hahayouthought"
.Attachments.Add (strLocation)
.Display
End With
On Error GoTo 0
Set OutMail = Nothing
End If
Next cell
【问题讨论】:
-
我不这么认为,但我不确定。我不精通 Outlook VBA。您能否举例说明如何将其包含在
.Body中?