Imprime un fichier texte
#include <File.au3>
_FilePrint ( $sFilePath [, $iShow = @SW_HIDE] )
$sFilePath | Le fichier � imprimer. |
$iShow | [optionnel] L'�tat de la fen�tre d'impression. (par d�faut = @SW_HIDE) |
Succ�s: | Retourne 1. |
�chec: | Retourne 0 et d�finit @error <> 0. |
Utilise la fonction ShellExecute de shell32.dll.
#include <File.au3> #include <MsgBoxConstants.au3> Local $sFilePath = FileOpenDialog("Print File", "", "Text Documents (*.txt)", $FD_FILEMUSTEXIST) If @error <> 0 Then Exit Local $iIsPrinted = _FilePrint($sFilePath) If $iIsPrinted = 1 Then MsgBox($MB_SYSTEMMODAL, "", "Le fichier a �t� imprim�.") Else MsgBox($MB_SYSTEMMODAL, "", "Erreur: " & @error & @CRLF & "Le fichier n'a pas �t� imprim�.") EndIf