Command Reference

Open Document

Opens, plays, prints or performs other actions on a document file using the associated viewer on the user's system.

When you perform this action on a document, Windows will open the document using the document viewer associated with that file type. For example, if you open a file called ReadMe.txt, the text file will most likely be opened with Notepad, unless the user has associated a different text viewer with the .txt file type on their system.

Action ID: 4
Action Category: Open/Close Programs

TIP

 

You can determine the associated viewer for any file type by using the Read File Association action.

Settings

File to open (path and file name)

The full path and file name of the program to open.

Verb

The shell "verb" that tells the viewer what to do with the file. You can type your own verb, or choose from:

Open

-

the "Open" shell verb

Print

-

the "Print" shell verb

Explore

-

the "Explore" shell verb

Play

-

the "Play" shell verb

Working directory

The working directory to use when opening the document.

Run mode

The run mode of the executed program. Choose from Normal, Minimized, or Maximized.

Normal

The viewer's interface will be sized "normally."

Minimized

The viewer will launch with its interface minimized.

Maximized

The viewer will launch with its interface maximized.

Return Values

Value
(%LastErrorNum%)

Simple Message
(%LastErrorMsg%)

Verbose Message
(%LastErrorDetails%)

0 (OK)

 

 

1

Error opening file.

The specified file was not found.
<<File to open>>

2

Error opening file.

The specified path was not found.
<<File to open>>

3

Error opening file.

The .exe file is invalid.
<<File to open>>

4

Error opening file.

The operating system denied access to the specified file.
<<File to open>>

5

Error opening file.

The file name association is incomplete or invalid.
<<File to open>>

6

Error opening file.

The DDE transaction could not be completed because other DDE transactions were being processed.
<<File to open>>

7

Error opening file.

The DDE transaction failed.
<<File to open>>

8

Error opening file.

The DDE transaction could not be completed because the request timed out.
<<File to open>>

9

Error opening file.

The specified dynamic-link library was not found.
<<File to open>>

10

Error opening file.

There is no application associated with the given file name extension.
<<File to open>>

11

Error opening file.

There was not enough memory to complete the operation.
<<File to open>>

12

Error opening file.

A sharing violation occurred.
<<File to open>>

Examples

Example 1

In this example, we will open our "Readme.txt" file in the default viewer for text files.

File to open (path and file name): %AppDir%\Readme.txt
Verb: open
Run mode: Normal

Example 2

In this example, we will use the print shell verb to print our "Readme.txt" file.

File to open (path and file name): %AppDir%\Readme.txt
Verb: print
Run mode: Normal

Example 3

In this example we will open the Indigo Rose web site in the user's default web browser.

File to open (path and file name): http://www.indigorose.com
Verb: open
Run mode: Normal

 

See Also: Alphabetical List of Actions, Categorical List of Actions, On Error tab