Share via


Application.CommandLine Property

Visio Automation Reference

Determines how Microsoft Office Visio was started. Read-only.

Version Information
 Version Added:  Visio 2000

Syntax

expression.CommandLine

expression   A variable that represents an Application object.

Return Value
String

Remarks

When you double-click a drawing, template, or stencil icon to start the application, the name of the file appears in the string returned by the CommandLine property. When you use a CreateObject call to start the application, "/Automation" appears in the string. When you double-click a Visio embedded object in an OLE container application, "/Embedding" appears in the string.

The following table includes other command line switches you can use to start the application.

Command line switch Description

/nonew

The Choose Drawing Type task pane is not shown on startup.

/nologo

The startup screen is not shown on startup.

/p filename

The Print dialog box is shown so you can quickly print a file.

filename

Opens a Visio file. Either the file has to be in the Drawings file path in the File Paths dialog box (on the Tools menu, click Options, click the Advanced tab, and then click File Paths), or you must name an absolute path.

/1, /2, /3,.../9

Opens one of the last-opened files.

/noreg

Prevents Visio from registering itself.

/u

Unregisters Visio.

/r

Registers Visio.

/s

Silently registers Visio.

/pt filename,[printername, drivername, portname]

Directs the file to print on a particular printer. (Added in Visio version 5.0c.)

::ODMA

Visio uses ODMA to open a file.

See Also