MS Word 2007 段落的唯一 ID

发布于 2024-08-27 11:07:44 字数 280 浏览 2 评论 0原文

我正在编写大型 MS Word 2007 文档,这些文档经常被更改。我必须用固定的唯一编号对段落进行编号,这些编号在更改文档时不会改变。这些号码应该是唯一的,并且即使删除以前的号码也不会改变。列表的顺序不是强制性的,可以在现有编号之前添加新编号(例如:顺序 1、4、3 表示编写了第 1-3 段,然后删除了#2,然后删除了#5)添加#3 不受后期编辑的影响)

该机制应该是文档内部的,因为我正在在线和离线工作。这些编号分别分配给每个文档。

由于我不知道如何在 MS Word 下编程,因此我希望获得完整的解决方案。

I am writing large MS Word 2007 documents, which are often being changed. I have to number paragraphs with stationary unique numbers, that will not change while changing the documents. The numbers should be unique, and will not change even if previous numbers are deleted. The order of the list is not mandatory, and addition of a new number before existing numbers is possible (for instance: the sequence 1, 4, 3 means that paragraphs 1-3 were written, then #2 was deleted, then #5 was added. #3 was not affected by the later editing)

The mechanism should be internal to the document, as I am working on line and off line. The numbers are allocated to every document individually.

Since I don't know to program under MS Word, I'd appreciate getting a complete solution.

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

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

发布评论

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

评论(2

稚然 2024-09-03 11:07:44

不,它不可能开箱即用。 Word 不会为段落分配永久索引。最简单的方法(但并非如此简单)就是以编程方式将每个段落范围项的索引号分配给 CustomXML 控件,该控件在加载时或运行时包装该段落。对于此解决方案或任何其他解决方案,您需要学习 Word 对象模型并通过 VBA 或 VSTO 或 OpenXML 对其进行编程。

Nope, it's not possible out-of-the-box. Word does not assign a permanent index to paragraphs. The simpliest way, but it ain't so simple, to do this is to programmatically assign an index number of each Paragraph range item to a CustomXML control that wraps the paragraph on load or whenever you run it. For this or any other solution, you'll need to learn the Word object model and program it through VBA or VSTO or OpenXML.

讽刺将军 2024-09-03 11:07:44

您可以将段落包装在内容控件(结构化文档标签)中;这些可以有 ID。

Iirc,Word 2010 允许段落有 ID。 M$ 添加了这个,因为他们需要它来进行 2010 年引入的并发编辑。

You can wrap a paragraph in a content control (structured document tag); these can have IDs.

Iirc, Word 2010 allows paragraphs to have IDs. M$ added this because they needed it for the concurrent editing introduced in 2010.

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