InsertFromFile method

Microsoft Visio Developer Reference

InsertFromFile method

   Example   

Adds a linked or embedded object to a page, master, or group.

Version added

4.1

Syntax

objRet = object.InsertFromFile(filename, flags)

objRet

A Shape object representing the newly linked or embedded object.

object

Required. An expression that returns a Page, Master, or Shape object in which to embed or link the object.

filename

Required String. The name of the file that contains the object to link or embed.

flags

Required Integer. Flags that influence how the object is inserted.

Remarks

The InsertFromFile method creates a new shape that represents a linked or embedded OLE object.

The flags argument is a bit mask that should be a combination of the following values.

Constant

Value

Description

visInsertLink

&H8

If set, the new shape represents an OLE link to the named file. Otherwise, the InsertFromFile method produces an OLE object from the contents of the named file and embeds it in the document that contains the page, master, or group.

visInsertIcon

&H10

Display the new shape as an icon.