Import Method
TOC
Collapse the table of content
Expand the table of content

Shape.Import Method (Visio)

Office 2013 and later
GitHub-Mark-64px

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

Imports a file into the current document.

expression .Import(FileName)

expression A variable that represents a Shape object.

Parameters

Name

Required/Optional

Data Type

Description

FileName

Required

String

The name of the file to import; must be a fully qualified path.

Return Value

Shape

The Import method imports the file specified by FileName onto a page, or into a master or group.

The file name extension indicates which import filter to use. If the filter is not installed, the Import method returns an error. The Import method uses the default preference settings for the specified filter and does not prompt the user for non-default arguments.

This Microsoft Visual Basic for Applications (VBA) macro shows how to use the Import method to import a bitmap image onto the drawing page. This example assumes that there is a file with the name sampleImage.bmp on drive C of your computer.

Public Sub Import_Example() 
 
 ActivePage.Import ("C:\sampleImage.bmp") 
 
End Sub 

Show:
© 2016 Microsoft