Reviewer

更新时间:
复制 MD 格式

This topic describes the API operations that are related to the Reviewer object of text documents.

Reviewers

ActiveDocument.ActiveWindow.View.Reviewers

Obtains all reviewers of the document.

Important

Only JS-SDK V1.1.10 and later support this feature.

  • Syntax

    expression.ActiveDocument.ActiveWindow.View.Reviewers

    expression: the document type application object.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Obtain all reviewers.
      const Reviewers = await app.ActiveDocument.ActiveWindow.View.Reviewers;
    }

Method

ActiveDocument.ActiveWindow.View.Reviewers.Item()

You can obtain a single reviewer by using the Item() method.

Important

Only JS-SDK V1.1.10 and later support this feature.

  • Syntax

    expression.ActiveDocument.ActiveWindow.View.Reviewers.Item(Index)

    expression: the document type application object.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Obtain all reviewers.
      const Reviewers = await app.ActiveDocument.ActiveWindow.View.Reviewers;
    
      // Obtain the first reviewer.
      await Reviewers.Item(1);
    }

Property

ActiveDocument.ActiveWindow.View.Reviewers.Count

You can obtain the number of reviewers by using the Count property.

Important

Only JS-SDK V1.1.10 and later support this feature.

  • Syntax

    expression.ActiveDocument.ActiveWindow.View.Reviewers.Count

    expression: the document type application object.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Obtain all reviewers.
      const Reviewers = await app.ActiveDocument.ActiveWindow.View.Reviewers;
    
      // Obtain the number of all reviewers.
      const count = await Reviewers.Count;
      console.log(count);
    }

Reviewer

Property

ActiveDocument.ActiveWindow.View.Reviewers.Item(Index).Visible

Modifies the comments or revisions by a reviewer. This property is used together with ActiveDocument.AcceptAllRevisionsShown(), ActiveDocument.RejectAllRevisionsShown and ActiveDocument.DeleteAllCommentsShown.

  • Syntax

    expression.ActiveDocument.ActiveWindow.View.Reviewers.Item(Index).Visible

    expression: the document type application object.

  • Examples

    //@file=base.docx
    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Obtain the first reviewer that revised the document.
      const Reviewer = await app.ActiveDocument.ActiveWindow.View.Reviewers.Item(1);
    
      // Use together with AcceptAllRevisionsShown, RejectAllRevisionsShown, and DeleteAllCommentsShown to modify comments or revisions by the reviewer.
      Reviewer.Visible = false;
    }
  • Use together with ActiveDocument.AcceptAllRevisionsShown() to accept all revisions in a document by a specific reviewer

    //@file=base.docx
    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Obtain the first reviewer that revised the document.
      const Reviewer = await app.ActiveDocument.ActiveWindow.View.Reviewers.Item(1);
    
      // Use together with AcceptAllRevisionsShown, RejectAllRevisionsShown, and DeleteAllCommentsShown to modify comments or revisions by the reviewer.
      Reviewer.Visible = true;
    
      // Accept all revisions by the reviewer in the document.
      await app.ActiveDocument.AcceptAllRevisionsShown();
    }
  • Use together with ActiveDocument.RejectAllRevisionsShown to reject all revisions in a document by a specific reviewer

    //@file=base.docx
    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Obtain the first reviewer that revised the document.
      const Reviewer = await app.ActiveDocument.ActiveWindow.View.Reviewers.Item(1);
    
      // Use together with AcceptAllRevisionsShown, RejectAllRevisionsShown, and DeleteAllCommentsShown to modify comments or revisions by the reviewer.
      Reviewer.Visible = true;
    
      // Reject all revisions by the reviewer in the document.
      await app.ActiveDocument.AcceptAllRevisionsShown();
    }
    
  • Use together with ActiveDocument.DeleteAllCommentsShown to delete all comments from a specific reviewer in a document

    //@file=base.docx
    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Obtain the first reviewer that revised the document.
      const Reviewer = await app.ActiveDocument.ActiveWindow.View.Reviewers.Item(1);
    
      // Use together with AcceptAllRevisionsShown, RejectAllRevisionsShown, and DeleteAllCommentsShown to modify comments or revisions by the reviewer.
      Reviewer.Visible = true;
    
      // Delete all comments by the reviewer in the document.
      await app.ActiveDocument.DeleteAllCommentsShown();
    }