Shapes.AddOLEControl method (Word)

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 a Shapes object.

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.

Return value

InlineShape

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

Shapes Collection Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.