View

Updated at:

This article describes the APIs for the View object in a word document.

Properties

ActiveDocument.ActiveWindow.View.Reviewers

Gets a collection of Reviewer objects for the document.

Important

This feature is available in JS-SDK v1.1.10 and later.

  • Syntax

    expression.ActiveDocument.ActiveWindow.View.Reviewers

    expression: A variable that represents an Application object.

  • Example

    async function example() {
      await instance.ready();
      const app = instance.Application;
      // Get the collection of Reviewer objects for the document.
      const Reviewers = await app.ActiveDocument.ActiveWindow.View.Reviewers;
    }

ActiveDocument.ActiveWindow.View.RevisionsFilter

Gets the RevisionsFilter object, which contains the current settings for displaying comments and revision marks.

Important

This feature is available in JS-SDK v1.1.10 and later.

  • Syntax

    expression.ActiveDocument.ActiveWindow.View.RevisionsFilter

    expression: A variable that represents an Application object.

  • Example

    async function example() {
      await instance.ready();
      const app = instance.Application;
      // Get settings for displaying comments and revision marks.
      const RevisionsFilter = await app.ActiveDocument.ActiveWindow.View.RevisionsFilter;
    }

ActiveDocument.ActiveWindow.View.ShowComments

Specifies whether comments are visible in the document.

Important

This feature is available in JS-SDK v1.1.10 and later.

  • Syntax

    expression.ActiveDocument.ActiveWindow.View.ShowComments = Boolean

    expression: A variable that represents an Application object.

    Set to true to display comments, or false to hide them.

  • Example

    async function example() {
      await instance.ready();
      const app = instance.Application;
      // Hide comments in the document.
      app.ActiveDocument.ActiveWindow.View.ShowComments = false;
    }

ActiveDocument.ActiveWindow.View.ShowRevisionsAndComments

Specifies whether to display revision marks. This property works in conjunction with ActiveDocument.ActiveWindow.RevisionsFilter.View.

  • Syntax

    expression.ActiveDocument.ActiveWindow.View.ShowRevisionsAndComments

    expression: A variable that represents an Application object.

Important

This feature is available in JS-SDK v1.1.10 and later.

  • Settings

    RevisionsFilter.View

    ShowRevisionsAndComments

    Effect

    RevisionsFilter.View = 0

    ShowRevisionsAndComments = true

    Displays the final version with revision marks.

    ShowRevisionsAndComments = false

    Displays the final version without revision marks.

    RevisionsFilter.View = 1

    ShowRevisionsAndComments = true

    Displays the original version with revision marks.

    ShowRevisionsAndComments = false

    Displays the original version without revision marks.

  • Examples

    • Display the final version with revision marks

      async function example() {
        await instance.ready();
        const app = instance.Application;
        // Get the View object.
        const View = await app.ActiveDocument.ActiveWindow.View;
        // Set the revision view to the final version.
        View.RevisionsFilter.View = 0;
        // Show revision marks.
        View.ShowRevisionsAndComments = true;
      }
    • Display the final version without revision marks

      async function example() {
        await instance.ready();
        const app = instance.Application;
        // Get the View object.
        const View = await app.ActiveDocument.ActiveWindow.View;
        // Set the revision view to the final version.
        View.RevisionsFilter.View = 0;
        // Hide revision marks.
        View.ShowRevisionsAndComments = false;
      }
    • Display the original version with revision marks

      async function example() {
        await instance.ready();
        const app = instance.Application;
        // Get the View object.
        const View = await app.ActiveDocument.ActiveWindow.View;
        // Set the revision view to the original version.
        View.RevisionsFilter.View = 1;
        // Show revision marks.
        View.ShowRevisionsAndComments = true;
      }
    • Display the original version without revision marks

      async function example() {
        await instance.ready();
        const app = instance.Application;
        // Get the View object.
        const View = await app.ActiveDocument.ActiveWindow.View;
        // Set the revision view to the original version.
        View.RevisionsFilter.View = 1;
        // Hide revision marks.
        View.ShowRevisionsAndComments = false;
      }

ActiveDocument.View.Zoom

Gets a Zoom object that contains the zoom options for the window or pane.

Important

This feature is available in JS-SDK v1.1.10 and later.

  • Syntax

    expression.ActiveDocument.View.Zoom

    expression: A variable that represents an Application object.

  • Example

    async function example() {
      await instance.ready();
      const app = instance.Application;
      // Get the Zoom object.
      const Zoom = await app.ActiveDocument.View.Zoom;
    }