问题描述
我想使用CDO.Message从MS Access发送几个附加文件。
当我使用objMessage.AddAttachment时我需要指出文件的完整路径,但是所有文件的超链接都存储在我的查询(记录集)的单独列中,但仅作为相对链接。如何将其更改为绝对超链接?
完整代码如下:
I want to send several attached files from MS Access using CDO.Message.
When I use "objMessage.AddAttachment" I need to indicate full path to the file, but all hyperlinks to files stored in separate column of my query (recordset) but as relative links only. How to change it to absolute hyperlinks?
Full code as below:
推荐答案
我担心这不是真的。没有没有哈希(#)字符的超链接。请参阅,了解有关超链接如何工作以及如何在需要时在代码中设置它们的更多信息。
对于您的情况,您需要提取相对的地址(除非你已经在某处获得了这些信息)。修复地址。除非它每次运行时都是相同的,否则只需要使用知识。最后,重做超链接,如链接线程中所述。请记住,任何电子邮件的收件人都必须能够从超链接中的任何内容访问该文件,因此如果驱动器号在其PC上必须相同,则它们才足够。否则你需要考虑UNC( \\Server \Share \ folders ... \ File )。
I''m afraid that is just not true. There is no hyperlink without the hash (#) characters. See Error 7980: HyperlinkAddress or HyperlinkSubAddress read-only for Hyperlink for more about how hyperlinks work and how to set them in code when you need to.
For your situation you will need to extract the address that is relative (unless you have that information somewhere already). Fix the address. Unless it is the same every time it''s run rou will need to use knowledge only you have. Lastly, redo the hyperlink as explained in the linked thread. Remember, the recipient of any email must be able to access the file from whatever is in the hyperlink, so drive letters are only adequate if they are necessarily the same on their PC. Otherwise you need to consider UNCs (\\Server\Share\folders...\File).
这篇关于如何在VBA中更改相对超链接到绝对超链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!