使用 .NET 自动更新 Word 文档的目录部分?

发布于 2024-08-20 05:44:47 字数 177 浏览 3 评论 0原文

在 Word 2007 中,您可以右键单击目录区域并告诉它更新其页码以指向该链接的当前页面所在的位置。我想通过 DocumentFormat.OpenXml 程序集以编程方式执行此操作,无需 COM。由于短语“目录”的性质,我在谷歌搜索时遇到了一些麻烦,并且在命名空间中找不到太多可以使用的内容。

这些组件可以实现这一点吗?

In Word 2007, you can right-click on a table of contents area and tell it to update its page numbers to point to wherever the current page of that link is. I'd like to do this programmatically, without COM, with the DocumentFormat.OpenXml assemblies. I'm having some troubles Googling it due to the nature of the phrase "table of contents," and can't find much in the namespace to work off of.

Is this possible with those assemblies?

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

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

发布评论

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

评论(2

燃情 2024-08-27 05:44:47

请参阅 OpenXML Developer 上的此主题:

如何更新 Word (.docx) 目录?

See this thread on OpenXML Developer:

How to update Word (.docx) TOC?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文