Shapes.AddOLEObject (Word)

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

AddOLEObject (ClassType, FileName, LinkToFile, DisplayAsIcon, IconFileName, IconIndex, IconLabel, Left, Top, Width, Height, Anchor)


ActiveDocument.Shapes.AddOLEObject _ 
 FileName:="c:\my documents\MyDrawing.bmp", _ 
 LinkToFile:=True

Arguments

Optional arguments

The following arguments are optional

ClassType (String) - The name of the application used to activate the specified OLE object.

FileName (String) - 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 (Boolean) - 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 (Boolean) - True to display the OLE object as an icon. The default value is False.

IconFileName (String) - The file that contains the icon to be displayed.

IconIndex (Long) - 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 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 (String) - A label (caption) to be displayed beneath the icon.

Left - Long

Top - Long

Width - Long

Height - Long

Anchor - Range