Microsoft Word 2007 不允许在其超链接中使用特殊字符

发布于 2024-10-30 05:16:31 字数 195 浏览 6 评论 0原文

我正在尝试使用 MS Word 2007 在 MS Word 文档中放置一个超链接,该超链接链接到包含大括号('{'、'}')和与号('&')的 URL。但是,Word 2007 不允许使用这些字符。它也不允许百分号('%'),所以我无法对这些字符进行 URL 编码。

关于如何链接到包含特殊字符的 URL 有什么建议吗?特别是大括号和&符号?

I am trying to put a hyperlink in a MS Word document using MS Word 2007 which links to a URL that includes curly brackets ('{', '}') and ampersands ('&'). Word 2007, however, does not allow these characters. Nor does it allow percent signs ('%') either, so I cannot URL encode these characters.

Any suggestions on how to link to a URL which includes special characters? Specifically curly brackets and ampersands?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

一页 2024-11-06 05:16:31

您是否尝试按照 这个答案

Have you tried inserting the links into the document as HTML as described in this answer?

ペ泪落弦音 2024-11-06 05:16:31

MS-Word 2007 允许使用特殊字符(包括大括号和与号)。它只是有一个验证正则表达式,当 URL 包含大括号和与号时,该正则表达式不符合该正则表达式。这些是我在 URL 验证之前删除的唯一字符,让我相信它们是导致 URL 无效的唯一原因,而不是整个 URL。更糟糕的是,MS-Word 2010 验证了 MS-Word 2007 没有验证的 URL。

MS-Word 2007 does allow special characters (including curly brackets and ampersands). It just has a validation regex that the URL did not comply when it had curly brackets and ampersands. Those were the only characters I removed before the URL validated, leading me to believe that they were the sole cause of the invalidation instead of the URL in its entirety. To make the problem even worse, MS-Word 2010 validated the URL which MS-Word 2007 did not.

心头的小情儿 2024-11-06 05:16:31

您可以逐个链接手动修复此问题,但过程很丑陋:

  1. 将您的 Word 文档从 blah.docx 更改为 blah.zip
  2. 解压文件
  3. 查找文件 < code>document.xml.rels
  4. 在记事本中编辑。找到您的特殊字符并替换:
    • { = %7B
    • } = %7D
    • & =%26
    • # = %23
  5. 保存您编辑的文件 document.xml.rels (即覆盖当前文件)
  6. ZIP 整个包备份
  7. 将您的新 ZIP 文件重命名为 .docx

You can fix this manually on a link by link basis but the process is ugly:

  1. Change your word document from blah.docx to blah.zip
  2. Unzip the file
  3. Find the file document.xml.rels
  4. Edit it in notepad. find your special characters and replace:
    • { = %7B
    • } = %7D
    • & = %26
    • # = %23
  5. Save your edited file document.xml.rels (i.e. overwrite the current one)
  6. ZIP the entire package back up
  7. Rename your new ZIP file to .docx
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文