# ActiveX

> See Aspose.Slides for Node.js ActiveX examples: insert, configure, and control ActiveX objects in PPT and PPTX presentations with clear JavaScript code.

Source: https://docs.aspose.com/slides/nodejs-java/examples/elements/activex/
Updated: 2026-08-05


This article demonstrates how to add, access, remove, and configure ActiveX controls in a presentation using **Aspose.Slides for Node.js via Java**.

## **Add an ActiveX Control**

Add a new ActiveX control to a slide.

```js
var aspose = aspose || {};
aspose.slides = require("aspose.slides.via.java");

function addActiveX() {
    let presentation = new aspose.slides.Presentation();
    try {
        let slide = presentation.getSlides().get_Item(0);

        // Add a new ActiveX control.
        let control = slide.getControls().addControl(aspose.slides.ControlType.WindowsMediaPlayer, 50, 50, 100, 50);

        presentation.save("activex.pptm", aspose.slides.SaveFormat.Pptm);
    } finally {
        presentation.dispose();
    }
}
```

## **Access an ActiveX Control**

Read information from the first ActiveX control on the slide.

```js
var aspose = aspose || {};
aspose.slides = require("aspose.slides.via.java");

function accessActiveX() {
    let presentation = new aspose.slides.Presentation("activex.pptm");
    try {
        let slide = presentation.getSlides().get_Item(0);

        if (slide.getControls().size() > 0) {
            // Access the first ActiveX control.
            let control = slide.getControls().get_Item(0);

            console.log("Control Name:", control.getName());
            console.log("Value:", control.getProperties().get_Item("Value"));
        }
    } finally {
        presentation.dispose();
    }
}
```

## **Remove an ActiveX Control**

Delete an existing ActiveX control from the slide.

```js
var aspose = aspose || {};
aspose.slides = require("aspose.slides.via.java");

function removeActiveX() {
    let presentation = new aspose.slides.Presentation("activex.pptm");
    try {
        let slide = presentation.getSlides().get_Item(0);

        if (slide.getControls().size() > 0) {
            // Remove the first ActiveX control.
            slide.getControls().removeAt(0);
        }

        presentation.save("activex_removed.pptm", aspose.slides.SaveFormat.Pptm);
    } finally {
        presentation.dispose();
    }
}
```

## **Set ActiveX Properties**

Configure several ActiveX properties.

```js
var aspose = aspose || {};
aspose.slides = require("aspose.slides.via.java");

function setActiveXProperties() {
    let presentation = new aspose.slides.Presentation("activex.pptm");
    try {
        let slide = presentation.getSlides().get_Item(0);

        if (slide.getControls().size() > 0) {
            let control = slide.getControls().get_Item(0);

            control.getProperties().set_Item("Caption", "Click Me");
            control.getProperties().set_Item("Enabled", "true");
        }

        presentation.save("activex_properties.pptm", aspose.slides.SaveFormat.Pptm);
    } finally {
        presentation.dispose();
    }
}
```



## Related articles

- [Manage PowerPoint Shapes in JavaScript](https://docs.aspose.com/slides/nodejs-java/powerpoint-shapes/)
- [Manage ActiveX Controls in Presentations Using JavaScript](https://docs.aspose.com/slides/nodejs-java/activex/)
- [Audio](https://docs.aspose.com/slides/nodejs-java/examples/elements/audio/)