PrintFile(String,String) Method
- Last UpdatedNov 06, 2025
- 1 minute read
The PrintFile() method opens the Print dialog to determine the target printer and then prints the specified file using the Windows PrintTo verb.
This overload of the method includes the path and docType parameters. The method uses the docType parameter to retrieve the print arguments for the file type from the File_Type table and pass them to Windows using the PrintTo 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 print arguments in the File_Type table to pass to Windows with the PrintTo verb.
When the method is called, it gets the user-selected target printer. It also looks up the file extension supplied by the docType parameter in the File_Type table to get the print arguments in the print_args column. If the print arguments contain a %FA parameter, it is removed from the arguments. The file name, print arguments, and target printer are then passed to Windows using the PrintTo verb to print the file.