超链接到Outlook附件 [英] Hyperlink to Outlook Attachment

查看:445
本文介绍了超链接到Outlook附件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将文档附加到Outlook电子邮件时,将创建该文档的副本并将其存储在某处.您显然可以链接到Outlook正文中的任何位置.本地文档的超链接对另一台计算机上的收件人(无权访问本地驱动器)将无用.

When you attach a document to an outlook email, a copy of the document is created and stored somewhere. You can obviously link to any location in the body of outlook. A hyperlink to a local document will not be useful to a recipient on another machine (without access to the local drive).

但是,有没有一种方法可以超链接到附件?我不认为有任何本地方法可以做到这一点,但是有没有可能的解决方案?

But, is there a way to hyperlink to an attached file? I don't think that there is any native way to do this, but is there any possible solution?

如果有关系,则仅Outlook可以阅读该电子邮件. (即公司内部办公室).

If it matters, the email will only be read by outlook. (i.e. intra office).

推荐答案

当然,您可以通过其content-id引用附件.查看下面的代码,在HTML正文中设置<a>标记,并在附件上设置PR_ATTACH_CONTENT_ID属性:

Sure, you can refer to an attachment by its content-id. Look at the code below setting the <a> tag in the HTML body and the PR_ATTACH_CONTENT_ID property on the attachment:

set msg = Application.CreateItem(0)
msg.To = "user@domain.demo"
msg.Subject = "test link"
msg.HTMLBody = "<html><body>click <a href=""cid:attachCid"">here</a> to open attachment</body></html>"
set attach = msg.Attachments.Add("c:\temp\test.txt")
attach.PropertyAccessor.SetProperty "http://schemas.microsoft.com/mapi/proptag/0x3712001F", "attachCid"
msg.Send

这篇关于超链接到Outlook附件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆