使用 .NET 自动更新 Word 文档的目录部分?
在 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
更多
发布评论
评论(2)
请参阅 OpenXML Developer 上的此主题:
如何更新 Word (.docx) 目录?
See this thread on OpenXML Developer:
How to update Word (.docx) TOC?
我们在类似线程中进行了长时间的讨论< /a> 关于在 OpneXML SDK 2.0 的帮助下生成目录 (TOC)。有一个解决方案可以实现这一目标。有关详细信息,请参阅此线程:如何生成使用 OpenXML SDK 2.0 的目录?
We have had a long discussion in similar thread regarding generating Table Of Content (TOC) with help of OpneXML SDK 2.0. And there is a solution to achieve that. Look at this thread for details: How to generate Table Of Contents using OpenXML SDK 2.0?