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)
Usage
Dim ClassType As Object
Dim Range As Object
Dim returnValue As InlineShape
Dim inlineShapes1 As InlineShapes
returnValue = inlineShapes1.AddOLEControl(ClassType, Range)
Syntax
Function AddOLEControl( _
<InAttribute()> Optional ByRef ClassType As Object, _
<InAttribute()> Optional ByRef Range As Object _
) As InlineShape
InlineShape AddOLEControl(
[In, Optional] ref object ClassType,
[In, Optional] ref object Range
);
public: InlineShape^ AddOLEControl(
&Object^ ClassType,
&Object^ Range
);
public InlineShape AddOLEControl(
/*in*/System.Object ClassType,
/*in*/System.Object Range
);
function AddOLEControl(
ClassType : Object,
Range : Object
) : InlineShape;
Parameters
- ClassType
Optional Object. The programmatic identifier for the ActiveX control to be created.
- Range
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.
Remarks
This method returns the InlineShape object that represents the new ActiveX control.
ActiveX controls are represented as either Microsoft.Office.Interop.Excel.Shape objects or InlineShape objects in Microsoft Word. To modify the properties for an ActiveX control, use the Microsoft.Office.Interop.Excel.OLEFormat.Object property of the Microsoft.Office.Interop.Excel.OLEFormat object for the specified shape or inline shape.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Platforms
Development Platforms
Windows XP Home Edition, Windows XP Professional, Windows Server 2003, and Windows 2000
Target Platforms
See Also
Reference
InlineShapes Interface
Microsoft.Office.Interop.Word Namespace