有没有办法使用 Word Interop 或 VBA 获取包含修订的段落(或任何范围)的原始文本?

发布于 2024-10-03 21:46:56 字数 64 浏览 0 评论 0原文

似乎访问修订范围只会给我更新的文本。我希望看到原来的文本,这样我就可以创建一个报告,其中包含“更改为”之类的内容。

Seems like accessing the revision ranges only gives me the updated text. I'd like to see the text as it originally was so I can create a report that says something like "Change to ."

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

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

发布评论

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

评论(2

剑心龙吟 2024-10-10 21:46:56

我相信,一旦获得范围对象,您就可以通过 Range.Revisions 访问对该范围所做的修订。

那么您必须枚举修订并查看修订的类型以确定它是什么类型的更改。

如果您想要原始版本,您可能必须打开文档的第二个副本,选择您的范围,然后拒绝该范围内的所有修订,读取该范围的值并浏览该文档的副本。

I believe that once you get a range object, you can access the revisions made to that range via Range.Revisions.

then you'll have to enum the revisions and look at the TYPE of revision to determine what kind of change it was.

If you want the original version, you may have to open a second copy of the document, select your range, then REJECT all the revisions in that range, read the value of the range and through that copy of the doc away.

月亮邮递员 2024-10-10 21:46:56

拒绝修订会将

Range.text

更改为原始文本。

然后,您可以撤消更改以将其恢复为修订后的文本。

Rejecting the revision will change

Range.text

to the original text.

You can then undo changes to set it back to revised text.

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