AddOLEObject Method Example

This example adds a new floating bitmap image to the active document. The bitmap is linked to another file.

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

This example adds a new Microsoft Excel worksheet to the active document at the second paragraph.

ActiveDocument.InlineShapes.AddOLEObject _
    ClassType:="Excel.Sheet", DisplayAsIcon:=False, _
    Range:=ActiveDocument.Paragraphs(2).Range