Function Reference


_FilePrint

Prints a plain text file

#include <File.au3>
_FilePrint ( $sFilePath [, $iShow = @SW_HIDE] )

Parameters

$sFilePath The file to print.
$iShow [optional] The state of the window. (default = @SW_HIDE)

Return Value

Success: 1.
Failure: 0 and sets the @error flag to non-zero.

Remarks

Uses the ShellExecute function of shell32.dll.

Example

#include <File.au3>
#include <MsgBoxConstants.au3>

Local $sFilePath = FileOpenDialog("Print File", "", "Text Documents (*.txt)", $FD_FILEMUSTEXIST)
If @error Then Exit

Local $iIsPrinted = _FilePrint($sFilePath)
If $iIsPrinted Then
        MsgBox($MB_SYSTEMMODAL, "", "The file was printed.")
Else
        MsgBox($MB_SYSTEMMODAL, "", "Error: " & @error & @CRLF & "The file was not printed.")
EndIf