Word VSTO 修订界面

Word VSTO Revision Interface

我正在 Visual Studio 中使用 C# 在 MS Word 功能区中制作自定义修订选项卡。在尝试弄清楚如何在 Word 中接受修订时,我遇到了这个 reference document

使用此文档,我想出了以下代码来尝试和测试修订版界面的一些功能:

int i = 0;

Object Rev = Microsoft.Office.Interop.Word.Revisions(i);    // Get the first revision object

Object Rng = Rev.Range;                                     // Get the Range object of the first revision

Microsoft.Office.Interop.Word.Revisions.Accept(i);          // Accept the first revision

第二行出错(Code Error ln2) which says Revisions cannot be used as a method, and an error on the fourth line Code Error ln4 which says Revisions has no definition for Accept, but from what I read in the reference document, this should be the proper syntax. Namespace Syntax , Revisions Syntax

提前致谢。

找出语法:

Word.Revision ThisRevision = Globals.ThisDocument.ActiveWindow.Selection.NextRevision();    // Get Next Revision

Word.Range RevRange = ThisRevision.Range;    // Get Range of Revision

ThisRevision.Accept();    // Accept Revision