Shapes.AddOLEControl Method (Word)

Office 2013 and later
GitHub-Mark-64px

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

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

expression .AddOLEControl(ClassType, Range)

expression Required. A variable that represents a Shapes 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.

Return Value

InlineShape

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.

Show: