InlineShapes.AddOLEObject Method

Creates an OLE object.

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

Syntax

'Declaration
Function AddOLEObject ( _
    ByRef ClassType As Object, _
    ByRef FileName As Object, _
    ByRef LinkToFile As Object, _
    ByRef DisplayAsIcon As Object, _
    ByRef IconFileName As Object, _
    ByRef IconIndex As Object, _
    ByRef IconLabel As Object, _
    ByRef Range As Object _
) As InlineShape
'Usage
Dim instance As InlineShapes
Dim ClassType As Object
Dim FileName As Object
Dim LinkToFile As Object
Dim DisplayAsIcon As Object
Dim IconFileName As Object
Dim IconIndex As Object
Dim IconLabel As Object
Dim Range As Object
Dim returnValue As InlineShape

returnValue = instance.AddOLEObject(ClassType, _
    FileName, LinkToFile, DisplayAsIcon, _
    IconFileName, IconIndex, IconLabel, _
    Range)
InlineShape AddOLEObject(
    ref Object ClassType,
    ref Object FileName,
    ref Object LinkToFile,
    ref Object DisplayAsIcon,
    ref Object IconFileName,
    ref Object IconIndex,
    ref Object IconLabel,
    ref Object Range
)

Parameters

  • ClassType
    Type: System.Object%
    Optional Object. The name of the application used to activate the specified OLE object.
  • FileName
    Type: System.Object%
    Optional Object. The file from which the object is to be created. If this argument is omitted, the current folder is used. You must specify either the ClassType or FileName argument for the object, but not both.
  • LinkToFile
    Type: System.Object%
    Optional Object. True to link the OLE object to the file from which it was created; False to make the OLE object an independent copy of the file. If you specified a value for ClassType, the LinkToFile argument must be False. The default value is False.
  • DisplayAsIcon
    Type: System.Object%
    Optional Object. True to display the OLE object as an icon. The default value is False.
  • IconFileName
    Type: System.Object%
    Optional Object. The file that contains the icon to be displayed.
  • IconIndex
    Type: System.Object%
    Optional Object. The index number of the icon within IconFileName. The order of icons in the specified file corresponds to the order in which the icons appear in the Change Icon dialog box (Insert menu, Object dialog box) when the Display as icon check box is selected. The first icon in the file has the index number 0 (zero). If an icon with the given index number doesn't 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.Object%
    Optional Object. A label (caption) to be displayed beneath the icon.
  • Range
    Type: System.Object%
    Optional Object. The range where the OLE object will be placed in the text. The OLE object replaces the range, unless the range is collapsed. If this argument is omitted, the object is placed automatically.

Return Value

Type: Microsoft.Office.Interop.Word.InlineShape

Remarks

Returns the InlineShape object that represents the new OLE object.

See Also

Reference

InlineShapes Interface

InlineShapes Members

Microsoft.Office.Interop.Word Namespace