ViewFile Method
- Last UpdatedNov 06, 2025
- 1 minute read
The ViewFile() method opens the specified file in the appropriate viewer application using the Windows Open verb.
Parameters
- path
- Required. Holds the path and file name of the file, including the file extension.
- docType
Required. Holds the file extension of the file, including the leading period (.) of the extension. This parameter is used to look up the view arguments in the File_Type table to pass to Windows with the Open verb.
| Exception | Description |
|---|---|
| System.Exception | Thrown if an error occurs retrieving information from the database. |
| System.ComponentModel.Win32Exception | Thrown if there is an error starting the program for viewing. |
When the method is called, it looks up the file extension supplied by the docType parameter in the File_Type table to get the view arguments in the view_args column. If the view arguments contain a %FA parameter, it is removed from the arguments. The file name and view arguments are then passed to Windows using the Open verb to open the file in the appropriate application.