内嵌word doc字段中的父文件地址是绝对的 [英] Parent file address, in embedded word doc fields is absoluted

查看:177
本文介绍了内嵌word doc字段中的父文件地址是绝对的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使其具有相对性?

我在"E:\Administration\Salary"中有"WB1.xlsm".

word文档嵌入在Sheet1中:(Microsoft Word启用宏的文档对象)

我确实进行了复制&将Cells(2,1)粘贴为嵌入词doc中的> Paste Link

该字段的代码中生成了一个绝对的父文件地址:

LINK Excel.SheetMacroEnabled.12 "E:\Administration\Salary\\WB1.xlsm" "Sheet1!R2C1" \a \f 4 \r  \* MERGEFORMAT

因此我无法移动Excel文件.

如何使链接字段中与父文档的application.path 相关的父文件地址? 父文档是Excel工作簿.

解决方案

LINK字段不能保留相对地址.您可能可以通过设置超链接库来解决此问题,MS错误地将其称为设置相对超链接.参见:

https://support.microsoft.com/zh-cn/help/903163/how-to-create-absolute-hyperlinks-and-relative-hyperlinks-in-word-docu

或者,对于适用于除LINK字段以外的其他字段的域代码解决方案以及适用于所有字段的宏,请参见:

http://windowssecrets.com/forums/showthread.php/154379-Word-Fields-and-Relative-Paths-to-External-Files

How can made it relative?

I have "WB1.xlsm" in "E:\Administration\Salary".

A word document was embedded in Sheet1: (Microsoft Word Macro-Enabled Document object)

I did Copy & Paste Cells(2,1) in the embedded word doc as Paste Special> Paste Link

There is an absolute parent file address have generated in the field's code:

LINK Excel.SheetMacroEnabled.12 "E:\Administration\Salary\\WB1.xlsm" "Sheet1!R2C1" \a \f 4 \r  \* MERGEFORMAT

So I can't move the Excel file.

How can make the parent file address which is in linked fields, related to the application.path of parent document? parent document is Excel Workbook.

解决方案

LINK fields cannot be made to retain a relative address. You may be able to resolve the issue by setting a hyperlink base, which MS wrongly refers to as setting a relative hyperlink. See:

https://support.microsoft.com/en-au/help/903163/how-to-create-absolute-hyperlinks-and-relative-hyperlinks-in-word-docu

Alternatively, for a field code solution that works with fields other than LINK fields, and a macro that works with all fields, see:

http://windowssecrets.com/forums/showthread.php/154379-Word-Fields-and-Relative-Paths-to-External-Files

这篇关于内嵌word doc字段中的父文件地址是绝对的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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