Share via


Shapes.AddOLEObject Method

Creates an OLE object. Returns a Shape object that represents the new OLE object.

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

Syntax

'Declaration
Function AddOLEObject ( _
    Left As Single, _
    Top As Single, _
    Width As Single, _
    Height As Single, _
    ClassName As String, _
    FileName As String, _
    DisplayAsIcon As MsoTriState, _
    IconFileName As String, _
    IconIndex As Integer, _
    IconLabel As String, _
    Link As MsoTriState _
) As Shape
'Usage
Dim instance As Shapes
Dim Left As Single
Dim Top As Single
Dim Width As Single
Dim Height As Single
Dim ClassName As String
Dim FileName As String
Dim DisplayAsIcon As MsoTriState
Dim IconFileName As String
Dim IconIndex As Integer
Dim IconLabel As String
Dim Link As MsoTriState
Dim returnValue As Shape

returnValue = instance.AddOLEObject(Left, _
    Top, Width, Height, ClassName, FileName, _
    DisplayAsIcon, IconFileName, IconIndex, _
    IconLabel, Link)
Shape AddOLEObject(
    float Left,
    float Top,
    float Width,
    float Height,
    string ClassName,
    string FileName,
    MsoTriState DisplayAsIcon,
    string IconFileName,
    int IconIndex,
    string IconLabel,
    MsoTriState Link
)

Parameters

  • Left
    Type: System.Single
    The position (in points) of the upper-left corner of the new object relative to the upper-left corner of the slide. The default value is 0 (zero).
  • Top
    Type: System.Single
    The position (in points) of the upper-left corner of the new object relative to the upper-left corner of the slide. The default value is 0 (zero).
  • Width
    Type: System.Single
    The initial width of the OLE object, in points.
  • Height
    Type: System.Single
    The initial height of the OLE object, in points.
  • ClassName
    Type: System.String
    The OLE long class name or the ProgID for the object that is to be created. You must specify either the ClassName or FileName argument for the object, but not both.
  • FileName
    Type: System.String
    The file from which the object is to be created. If the path is not specified, the current working folder is used. You must specify either the ClassName or FileName argument for the object, but not both.
  • IconFileName
    Type: System.String
    The file that contains the icon to be displayed.
  • IconIndex
    Type: System.Int32
    The index of the icon within IconFileName. The first icon in the file has the index number 0 (zero). If an icon with the given index number does not exist in IconFileName, the icon with the index number 1 (the second icon in the file) is used. The default value is 0 (zero).
  • IconLabel
    Type: System.String
    A label (caption) to be displayed underneath the icon.
  • Link
    Type: Microsoft.Office.Core.MsoTriState
    Determines whether the OLE object will be linked to the file from which it was created. If you specified a value for ClassName, this argument must be msoFalse.

Return Value

Type: Microsoft.Office.Interop.PowerPoint.Shape

See Also

Reference

Shapes Interface

Shapes Members

Microsoft.Office.Interop.PowerPoint Namespace