編輯

共用方式為


Shapes.AddOLEObject Method

Definition

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

public Microsoft.Office.Interop.Word.Shape AddOLEObject (ref object ClassType, ref object FileName, ref object LinkToFile, ref object DisplayAsIcon, ref object IconFileName, ref object IconIndex, ref object IconLabel, ref object Left, ref object Top, ref object Width, ref object Height, ref object Anchor);
abstract member AddOLEObject : obj * obj * obj * obj * obj * obj * obj * obj * obj * obj * obj * obj -> Microsoft.Office.Interop.Word.Shape
Public Function AddOLEObject (Optional ByRef ClassType As Object, Optional ByRef FileName As Object, Optional ByRef LinkToFile As Object, Optional ByRef DisplayAsIcon As Object, Optional ByRef IconFileName As Object, Optional ByRef IconIndex As Object, Optional ByRef IconLabel As Object, Optional ByRef Left As Object, Optional ByRef Top As Object, Optional ByRef Width As Object, Optional ByRef Height As Object, Optional ByRef Anchor As Object) As Shape

Parameters

ClassType
Object

Optional Object. The name of the application used to activate the specified OLE object.

FileName
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
Object

OptionalObject. 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
Object

Optional Object. True to display the OLE object as an icon. The default value is False.

IconFileName
Object

Optional Object. The file that contains the icon to be displayed.

IconIndex
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
Object

Optional Object. A label (caption) to be displayed beneath the icon.

Left
Object

Optional Object. The position (in points) of the left edge of the new object relative to the anchor.

Top
Object

Optional Object. The position (in points) of the upper edge of the new object relative to the anchor.

Width
Object

Optional Object. The width of the OLE object, in points.

Height
Object

Optional Object. The height of the OLE object, in points.

Anchor
Object

Optional Object. The range to which the OLE object is bound. If Anchor is specified, the anchor is positioned at the beginning of the first paragraph of the anchoring range. If Anchor is not specified, the anchor is placed automatically and the OLE Object is positioned relative to the top and left edges of the page.

Returns

Applies to