InlineShapes.AddOLEControl Method

Word Developer Reference

Creates an ActiveX control (formerly known as an OLE control). Returns the InlineShape object that represents the new ActiveX control.

Syntax

expression.AddOLEControl(ClassType, Range)

expression   Required. A variable that represents an InlineShapes collection.

Parameters

Name Required/Optional Data Type Description
ClassType Optional Variant The programmatic identifier for the ActiveX control to be created.
Range Optional Variant The range where the ActiveX control will be placed in the text. The ActiveX control replaces the range, if the range isn't collapsed. If this argument is omitted, the Active X control is placed automatically.

Remarks

ActiveX controls are represented as either Shape objects or InlineShape objects in Microsoft Word. To modify the properties for an ActiveX control, you use the Object property of the OLEFormat object for the specified shape or inline shape.

For information about available ActiveX control class types, see OLE Programmatic Identifiers .

See Also