excel - 将超链接(Web)添加到 Outlook 电子邮件
问题描述
我在嵌入指向此类文本的超链接时遇到问题。
我正在从 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
解决方案
尝试与.HTMLBody
例子
.HTMLBody = "<A href=https://www.google.com/> Click Here </A>"
返回或设置一个表示指定项的 HTML 正文的字符串。HTMLBody 属性应该是一个 HTML 语法字符串。读/写。
返回或设置一个表示 Outlook 项目的明文正文的字符串。读/写。
推荐阅读
- wordpress - 调整 .htaccess 链接后导致重定向过多
- dart - 如何在飞镖中将字符串转换为Uuid
- firebase-authentication - Apple 登录 - 检索姓名和电子邮件
- reactjs - 如何在玩笑测试中共享设置和拆卸?
- database - 我可以删除显示无法连接的 postgres 数据库吗?
- python - 匹配 Pandas DataFrame 时出现“KeyError: True”
- perl - 如何获取已知 Unicode 字符名称的列表
- firebase - 异步函数:未来
在颤振中布尔? - r - 循环回归和存储截距、斜率等
- python - PermissionError:[错误 13] 权限被拒绝:scr.png