Support of ActiveX TextBox | Change the properties of ActiveX using Java

Hello,

is it possible to change the properties of ActiveX type objects? I have created a test file which copies a Text Box (Active Control) object from another document and tried to change its properties, however, it doesn’t seem to work.

        final Document doc = new Document(System.getProperty("user.dir") + File.separator + "activex_textbox.docx");
        Shape activeXTextBox = (Shape) doc.getChildNodes(NodeType.SHAPE, true).get(0);

        final Document destination = documentBuilder.getDocument();
        final Shape shapeClone = (Shape)destination.importNode(activeXTextBox, true);

        final Paragraph firstParagraph = shapeClone.getFirstParagraph();
        final OleControl oleControl = shapeClone.getOleFormat().getOleControl();
        Forms2OleControl textBox = (Forms2OleControl) oleControl;

        shapeClone.setWidth(100D);
        shapeClone.setHeight(100D);
        shapeClone.setFillColor(Color.cyan);
        shapeClone.setLeft(800);

        documentBuilder.insertNode(shapeClone);
        saveDocument(documentBuilder);

In the attachment, I also send a photo of all the properties that can be edited in MsWord. Is there a way to change the selected properties on the Aspose library side (ver. 21.1)?
activeX.zip (174.0 KB)

@aolo23

Unfortunately, Aspose.Words does not support to work with ActiveX control at the moment. However, we have logged this feature request as WORDSNET-21821 in our issue tracking system. You will be notified via this forum thread once this feature is available.

We apologize for your inconvenience.

1 Like