excel - Add file link to email body VBA
问题描述
I'd like to add a network file link to my email body using Excel VBA.
The code below add the text, but I'd like file location to be a hyperlink?
strbody_2 = "<BODY style=font-size:11pt;font-family:Calibri><b><u>" & "CapAd File:" & "</b><u>" & "<br>" _
& Sheets("Control").Range("CapAd_File") _ ' THIS IS THE FILE LOCATION
& "</b></u>"
解决方案
尝试使用 html <a>
-Anchor 标签:
strbody_2 = "<BODY style=font-size:11pt;font-family:Calibri><b><u>" & "CapAd File:" & "</b><u>" & "<br>" _
& "<a href=""" & Sheets("Control").Range("CapAd_File") & """>" _
& Sheets("Control").Range("CapAd_File") _ ' THIS IS THE FILE LOCATION
& "</a></b></u>"
(对不起,如果我没有得到正确的撇号,我在发布之前没有测试它)
推荐阅读
- node.js - 安装 mobileui 时出错 npm install -g mobileui
- javascript - 使用 toggleClass 单击它时更改眼睛图标
- android - 找不到方法 flavor1ReleaseImplementation()
- python - 如何替换与python中关键字字符串列表匹配的列表列表中的值
- c# - 如何在 Visual Studio 2019 C# 中的 .Net Core Windows 窗体应用程序中编写菜单/子菜单
- sql - 我们可以添加什么来使 Oracle 中的查询运行更快?下面是 Oracle 查询缓慢
- java - 如何使用 quarkus 在父 maven 项目中创建自定义自动配置
- python - 如何更改和使用 Pytorch 训练的 Scaled Yolov4 权重以在 Opencv 中使用(作为 .weights 文件)?
- javascript - 如何在 NodeJS 中的文件之间共享数据?
- c - 在 for 循环中,在 C 语言中,变量 int i 具有与预期不同的值