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