java.lang.Object
com.aspose.words.OleControl
public class OleControl
To learn more, visit the Working with Ole Objects documentation article. Example:
Document doc = new Document(getMyDir() + "ActiveX controls.docx");
Shape shape = (Shape) doc.getChild(NodeType.SHAPE, 0, true);
OleControl oleControl = shape.getOleFormat().getOleControl();
Assert.assertEquals(oleControl.getName(), "CheckBox1");
if (oleControl.isForms2OleControl()) {
Forms2OleControl checkBox = (Forms2OleControl) oleControl;
Assert.assertEquals(checkBox.getCaption(), "First");
Assert.assertEquals(checkBox.getValue(), "0");
Assert.assertEquals(checkBox.getEnabled(), true);
Assert.assertEquals(checkBox.getType(), Forms2OleControlType.CHECK_BOX);
Assert.assertEquals(checkBox.getChildNodes(), null);
}
| Property Getters/Setters Summary | ||
|---|---|---|
boolean | isForms2OleControl() | |
Returns true if the control is a |
||
java.lang.String | getName() | |
void | setName(java.lang.String value) | |
| Gets or sets name of the ActiveX control. | ||
| Property Getters/Setters Detail |
|---|
isForms2OleControl | |
public boolean isForms2OleControl() | |
true if the control is a Example:
Shows how to verify the properties of an ActiveX control.
Document doc = new Document(getMyDir() + "ActiveX controls.docx");
Shape shape = (Shape) doc.getChild(NodeType.SHAPE, 0, true);
OleControl oleControl = shape.getOleFormat().getOleControl();
Assert.assertEquals(oleControl.getName(), "CheckBox1");
if (oleControl.isForms2OleControl()) {
Forms2OleControl checkBox = (Forms2OleControl) oleControl;
Assert.assertEquals(checkBox.getCaption(), "First");
Assert.assertEquals(checkBox.getValue(), "0");
Assert.assertEquals(checkBox.getEnabled(), true);
Assert.assertEquals(checkBox.getType(), Forms2OleControlType.CHECK_BOX);
Assert.assertEquals(checkBox.getChildNodes(), null);
}getName/setName | |
public java.lang.String getName() / public void setName(java.lang.String value) | |
Example:
Shows how to verify the properties of an ActiveX control.
Document doc = new Document(getMyDir() + "ActiveX controls.docx");
Shape shape = (Shape) doc.getChild(NodeType.SHAPE, 0, true);
OleControl oleControl = shape.getOleFormat().getOleControl();
Assert.assertEquals(oleControl.getName(), "CheckBox1");
if (oleControl.isForms2OleControl()) {
Forms2OleControl checkBox = (Forms2OleControl) oleControl;
Assert.assertEquals(checkBox.getCaption(), "First");
Assert.assertEquals(checkBox.getValue(), "0");
Assert.assertEquals(checkBox.getEnabled(), true);
Assert.assertEquals(checkBox.getType(), Forms2OleControlType.CHECK_BOX);
Assert.assertEquals(checkBox.getChildNodes(), null);
}