Window

Updated at:

This topic describes the Window object APIs for text documents.

Window

ActiveDocument.ActiveWindow

Retrieves the current active window.

Syntax: expression.ActiveDocument.ActiveWindow. expression represents the document application object.

Methods

ActiveDocument.ActiveWindow.RangeFromPoint()

The RangeFromPoint() method retrieves a range or shape object that extends from the upper-left corner of the document body to a specified point.

Important

This feature is supported in the SDK for JavaScript V1.1.10 and later.

  • Syntax

    expression.ActiveDocument.ActiveWindow.RangeFromPoint(x, y)

    Expression: Document-type application object.

  • Parameters

    Parameter

    Data type

    Required

    Description

    x

    Number

    Yes

    The horizontal distance, in pixels, from the upper-left corner of the document body to the point. This distance is not affected by scrolling.

    y

    Number

    Yes

    The vertical distance, in pixels, from the upper-left corner of the document body to the point. This distance is not affected by scrolling.

  • Return value

    Returns the range or shape object.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
    
      // Get the range or shape object from the upper-left corner of the document body to a specified point.
      const range = await app.ActiveDocument.ActiveWindow.RangeFromPoint(10, 10);
      console.log(range);
     
    }

ActiveDocument.ActiveWindow.ScrollIntoView()

The ScrollIntoView() method scrolls the document window to make a specified range or shape object visible.

Important

This feature is supported in the SDK for JavaScript V1.1.10 and later.

  • Syntax

    (expression).ActiveDocument.ActiveWindow.ScrollIntoView(Obj)

    expression represents the document application object.

  • Parameters

    Property

    Data type

    Required

    Description

    Obj

    Range

    Yes

    The specified range.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
    
      // Scroll the document window to make the specified range or shape object visible.
      await app.ActiveDocument.ActiveWindow.ScrollIntoView(range)
    
    }

Properties

ActiveDocument.ActiveWindow.DocumentMap

The DocumentMap property shows or hides the document map. For more information, see Document Map.

Important

This feature is supported in the SDK for JavaScript V1.1.10 and later.

  • Syntax

    expression.ActiveDocument.ActiveWindow.DocumentMap = Boolean

    Expression: Application object for the document type

    Set Boolean to true to show the document map. Set it to false to hide the document map.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Show the document map.
      app.ActiveDocument.ActiveWindow.DocumentMap = true;
    }

ActiveWindow.Selection

The Selection property retrieves a Selection object that represents the selected range or the insertion point. For more information, see Selection.

Important

This feature is supported in the SDK for JavaScript V1.1.10 and later.

  • Syntax

    expression.ActiveWindow.Selection

    Expression: Application object for a document type

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
    
      // Get a Selection object.
      const Selection = await app.ActiveWindow.Selection;
    }

ActiveWindow.ActivePane

The ActivePane property retrieves a Pane object that represents the active pane of the specified window.

Important

This feature is supported in the SDK for JavaScript V1.1.10 and later.

  • Syntax

    expression.ActiveWindow.ActivePane

    expression represents the document application object.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
    
      // Get a Pane object.
      const ActivePane = await app.ActiveWindow.ActivePane;
    }

ActiveWindow.View

The View property retrieves a View object that represents the view of the specified window or pane.

Important

This feature is supported in the SDK for JavaScript V1.1.10 and later.

  • Syntax

    expression.ActiveWindow.View

    expression represents the document application object.

  • Example

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