Partager via


Shapes.AddOLEControl Method

Creates an ActiveX control (formerly known as an OLE control). Returns the Shape object that represents the new ActiveX 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 Left As Object, _
    ByRef Top As Object, _
    ByRef Width As Object, _
    ByRef Height As Object, _
    ByRef Anchor As Object _
) As Shape
'Usage
Dim instance As Shapes
Dim ClassType As Object
Dim Left As Object
Dim Top As Object
Dim Width As Object
Dim Height As Object
Dim Anchor As Object
Dim returnValue As Shape

returnValue = instance.AddOLEControl(ClassType, _
    Left, Top, Width, Height, Anchor)
Shape AddOLEControl(
    ref Object ClassType,
    ref Object Left,
    ref Object Top,
    ref Object Width,
    ref Object Height,
    ref Object Anchor
)

Parameters

  • ClassType
    Type: System.Object%
    Optional Object. The programmatic identifier for the ActiveX control to be created.
  • Left
    Type: System.Object%
    Optional Object. The position (in points) of the left edge of the new object relative to the anchor.
  • Top
    Type: System.Object%
    Optional Object. The position (in points) of the upper edge of the new object relative to the anchor.
  • Width
    Type: System.Object%
    Optional Object. The width of the ActiveX control, in points.
  • Height
    Type: System.Object%
    Optional Object.The height of the ActiveX control, in points.
  • Anchor
    Type: System.Object%
    Optional Object. The range to which the ActiveX control is bound. If Anchor is specified, the anchor is positioned at the beginning of the first paragraph in the anchoring range. If this argument is omitted, however, the anchor is placed automatically and the ActiveX control is positioned relative to the top and left edges of the page.

Return Value

Type: Microsoft.Office.Interop.Word.Shape

See Also

Reference

Shapes Interface

Shapes Members

Microsoft.Office.Interop.Word Namespace