InlineShapes.AddOLEControl Method

Creates an ActiveX control (formerly known as an OLE control).

Namespace:  Microsoft.Office.Interop.Word
Assembly:  Microsoft.Office.Interop.Word (in Microsoft.Office.Interop.Word.dll)

Syntax

'Declaration
Function AddOLEControl ( _
    ByRef ClassType As Object, _
    ByRef Range As Object _
) As InlineShape
'Usage
Dim instance As InlineShapes
Dim ClassType As Object
Dim Range As Object
Dim returnValue As InlineShape

returnValue = instance.AddOLEControl(ClassType, _
    Range)
InlineShape AddOLEControl(
    ref Object ClassType,
    ref Object Range
)

Parameters

  • ClassType
    Type: System.Object%
    Optional Object. The programmatic identifier for the ActiveX control to be created.
  • Range
    Type: System.Object%
    Optional Object. 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

Type: Microsoft.Office.Interop.Word.InlineShape

Remarks

This method returns the InlineShape object that represents the new ActiveX control.

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

See Also

Reference

InlineShapes Interface

InlineShapes Members

Microsoft.Office.Interop.Word Namespace