Dumps the contents of a file to a printer.
[Visual Basic]
Public Function WriteFile( _
ByVal FileName As String _
) As Integer
[C#]
public int WriteFile(
string FileName
);
FileName
The name of the file to be dumped to the printer. If no path is specified, the application will first look for the file in the executing directory. If not found there, the application will look in the root directory.
Positive return indicates that text was sent.
Negative value indicates that the method was called before Open, or after Close or Cancel.
Zero return indicates that the file was empty.
The most common use of this function is to print a report that has already been formatted for a specific printer. The report is buffered in a file and then printed in one function call.
Note that all graphics or printer control characters must already be embedded in the file and formatted for the specific printer before it is sent to the printer. Properties such as PageNumber are not updated by this function, and therefore will be incorrect after the function is called.