InlineShapes.AddOLEObject MethodÂ
Creates an OLE object.
Namespace: Microsoft.Office.Interop.Word
Assembly: Microsoft.Office.Interop.Word (in microsoft.office.interop.word.dll)
Usage
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
Dim inlineShapes1 As InlineShapes
returnValue = inlineShapes1.AddOLEObject(ClassType, FileName, LinkToFile, DisplayAsIcon, IconFileName, IconIndex, IconLabel, Range)
Syntax
Function AddOLEObject( _
<InAttribute()> Optional ByRef ClassType As Object, _
<InAttribute()> Optional ByRef FileName As Object, _
<InAttribute()> Optional ByRef LinkToFile As Object, _
<InAttribute()> Optional ByRef DisplayAsIcon As Object, _
<InAttribute()> Optional ByRef IconFileName As Object, _
<InAttribute()> Optional ByRef IconIndex As Object, _
<InAttribute()> Optional ByRef IconLabel As Object, _
<InAttribute()> Optional ByRef Range As Object _
) As InlineShape
InlineShape AddOLEObject(
[In, Optional] ref object ClassType,
[In, Optional] ref object FileName,
[In, Optional] ref object LinkToFile,
[In, Optional] ref object DisplayAsIcon,
[In, Optional] ref object IconFileName,
[In, Optional] ref object IconIndex,
[In, Optional] ref object IconLabel,
[In, Optional] ref object Range
);
public: InlineShape^ AddOLEObject(
&Object^ ClassType,
&Object^ FileName,
&Object^ LinkToFile,
&Object^ DisplayAsIcon,
&Object^ IconFileName,
&Object^ IconIndex,
&Object^ IconLabel,
&Object^ Range
);
public InlineShape AddOLEObject(
/*in*/System.Object ClassType,
/*in*/System.Object FileName,
/*in*/System.Object LinkToFile,
/*in*/System.Object DisplayAsIcon,
/*in*/System.Object IconFileName,
/*in*/System.Object IconIndex,
/*in*/System.Object IconLabel,
/*in*/System.Object Range
);
function AddOLEObject(
ClassType : Object,
FileName : Object,
LinkToFile : Object,
DisplayAsIcon : Object,
IconFileName : Object,
IconIndex : Object,
IconLabel : Object,
Range : Object
) : InlineShape;
Parameters
- ClassType
Optional Object. The name of the application used to activate the specified OLE object.
- FileName
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
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
Optional Object. True to display the OLE object as an icon. The default value is False.
- IconFileName
Optional Object. The file that contains the icon to be displayed.
- IconIndex
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
Optional Object. A label (caption) to be displayed beneath the icon.
- Range
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.
Remarks
Returns the InlineShape object that represents the new OLE object.
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