All Products
Search
Document Center

Intelligent Media Management:ActiveWindow

Last Updated:Apr 30, 2025

This topic describes the API operations that are related to the ActiveWindow object of presentation documents.

ActiveWindow

Returns the ActiveWindow object of a presentation document.

  • Syntax

    expression.ActiveWindow

    expression: the application object of the document type.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Obtain the document window object.
      const activeWindow = await app.ActiveWindow;
    }

View

ActiveWindow.View

Returns the View object.

  • Syntax

    expression.ActiveWindow.View

    expression: the application object of the document type.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Obtain the document window object.
      const activeWindow = await app.ActiveWindow;
    
      // Obtain the View object.
      const view = await activeWindow.View;
    }

Properties

ActiveWindow.View.Zoom

Returns or sets the zoom percentage of the specified view.

  • Syntax

    expression.ActiveWindow.View.Zoom

    expression: the application object of the document type.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Obtain the document window object.
      const activeWindow = await app.ActiveWindow;
    
      // Obtain the View object.
      const view = await activeWindow.View;
    
      // Obtain the percentage by which the document window is zoomed. The default value is 100.
      const result = await view.Zoom;
      console.log(result);
    
      // Specify the percentage by which the document window is zoomed.
      view.Zoom = 66;
    }

ActiveWindow.View.ZoomToFit

Sets whether to zoom the view to fit the size of the document window after the document window is resized.

  • Syntax

    expression.ActiveWindow.View.ZoomToFit = Number

    expression: the application object of the document type.

    Valid values of the Number parameter:

    • -1: zooms the view to fit the size of the document window after the document window is resized.

    • 0: does not zoom the view to fit the size of the document window after the document window is resized.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Obtain the document window object.
      const activeWindow = await app.ActiveWindow;
    
      // Obtain the View object.
      const view = await activeWindow.View;
    
      // Obtain the percentage by which the document window is zoomed. The default value is 100.
      const result = await view.Zoom;
      console.log(result);
    
      // Specify the percentage by which the document window is zoomed.
      view.Zoom = 66;
    
      // Do not zoom the view to fit the size of the document window.
      view.ZoomToFit = 0;
    }

Selection

ActiveWindow.Selection

Specifies content in a document window.

  • Syntax

    expression.ActiveWindow.Selection

    expression: the application object of the document type.

  • Example

    //@file=base.pptx
    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Obtain the document window object.
      const activeWindow = await app.ActiveWindow;
    
      // Obtain the Selection object.
      const selection = await activeWindow.Selection;
    }

Methods

ActiveWindow.Selection.ClearShapeSelect

Deselects the Selection object.

Important

Only JavaScript SDK V1.1.14 and later support this feature.

  • Syntax

    expression.ActiveWindow.Selection.ClearShapeSelect

    expression: the application object of the document type.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Obtain the document window object.
      const activeWindow = await app.ActiveWindow;
    
      // Obtain the Selection object.
      const selection = await activeWindow.Selection;
    
     // Deselect the object.
      await selection.ClearShapeSelect()
    }

ActiveWindow.Selection.Copy

Copies the selected slide.

Important

Only JavaScript SDK V1.1.14 and later support this feature.

  • Syntax

    expression.ActiveWindow.Selection.Copy

    expression: the application object of the document type.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Obtain the document window object.
      const activeWindow = await app.ActiveWindow;
    
      // Obtain the Selection object.
      const selection = await activeWindow.Selection;
    
     // Copy the selected slide.
      const data = await selection.Copy()
    }

ActiveWindow.Selection.Paste

Pastes the copied slide.

Important

Only JavaScript SDK V1.1.14 and later support this feature.

  • Syntax

    expression.ActiveWindow.Selection.Paste

    expression: the application object of the document type.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Obtain the document window object.
      const activeWindow = await app.ActiveWindow;
    
      // Obtain the Selection object.
      const selection = await activeWindow.Selection;
    
     // Copy and paste the selected slide.
      const data = await selection.Copy()
      await selection.Paste(data)
    }

SlideRange

ActiveWindow.Selection.SlideRange

Returns a collection of all slides in the selected range.

Important

Only JavaScript SDK V1.1.14 and later support this feature.

  • Syntax

    expression.ActiveWindow.Selection.SlideRange

    expression: the application object of the document type.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Obtain the presentation object.
      const presentation = await app.ActiveWindow.Selection;
    
      // Obtain the collection of all slides in the selected range.
      const view = await presentation.SlideRange;
    }

Method

ActiveWindow.Selection.SlideRange.Item()

Returns a single slide in the selected range.

Important

Only JavaScript SDK V1.1.14 and later support this feature.

  • Parameter

    Property

    Data type

    Required

    Description

    Index

    Number

    Yes

    The index number of the slide.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Obtain the presentation object.
      const presentation = await app.ActiveWindow.Selection;
    
      // Obtain the collection of all slides in the selected range.
      const view = await presentation.SlideRange;
    
      // Obtain a single slide.
      await app.ActiveWindow.Selection.SlideRange.Item(1);
    }

Property

ActiveWindow.Selection.SlideRange.Count

Returns a specified number of slides in the selected range.

Important

Only JavaScript SDK V1.1.14 and later support this feature.

  • Syntax

    expression.ActiveWindow.Selection.SlideRange.Count

    expression: the application object of the document type.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Obtain the presentation object.
      const presentation = await app.ActiveWindow.Selection;
    
      // Obtain the collection of all slides in the selected range.
      const view = await presentation.SlideRange;
    
      // Obtain the number of slides in the selected range.
      const count = await app.ActiveWindow.Selection.SlideRange.Count
      console.log(count);
    }