cppman Posted February 8, 2006 Share Posted February 8, 2006 hello people. im back. lol. Is their any function to print text using the printer? like actually print it out of the user's default printer? i've been searching the help file, and all over the forum. can't find anything about it. i appreciate your help. Miva OS Project Link to comment Share on other sites More sharing options...
Valuater Posted February 8, 2006 Share Posted February 8, 2006 (edited) Straight from help #include <File.au3> $file = FileOpenDialog("Print File", "", "Text Documents (*.txt)", 1) If @error Then Exit $print = _FilePrint($file) If $print Then MsgBox(0, "Print", "The file was printed.") Else MsgBox(0, "Print", "Error: " & @error & @CRLF & "The file was not printed.") EndIf 8) Edited February 8, 2006 by Valuater Link to comment Share on other sites More sharing options...
skippynz Posted February 8, 2006 Share Posted February 8, 2006 hello people. im back. lol. Is their any function to print text using the printer? like actually print it out of the user's default printer? i've been searching the help file, and all over the forum. can't find anything about it. i appreciate your help. its in the helpfile beta version #include <File.au3> $file = FileOpenDialog("Print File", "", "Text Documents (*.txt)", 1) If @error Then Exit $print = _FilePrint($file) If $print Then MsgBox(0, "Print", "The file was printed.") Else MsgBox(0, "Print", "Error: " & @error & @CRLF & "The file was not printed.") EndIf Link to comment Share on other sites More sharing options...
skippynz Posted February 8, 2006 Share Posted February 8, 2006 Straight from help #include <File.au3> $file = FileOpenDialog("Print File", "", "Text Documents (*.txt)", 1) If @error Then Exit $print = _FilePrint($file) If $print Then MsgBox(0, "Print", "The file was printed.") Else MsgBox(0, "Print", "Error: " & @error & @CRLF & "The file was not printed.") EndIf 8) great minds think alike - hahaha Link to comment Share on other sites More sharing options...
cppman Posted February 8, 2006 Author Share Posted February 8, 2006 yeah... i tried that earlier but it was'nt "Printing" for me. thanks, and sry to take ur time.great minds think alike - hahaha Miva OS Project Link to comment Share on other sites More sharing options...
Valuater Posted February 8, 2006 Share Posted February 8, 2006 not working for me either 8) Link to comment Share on other sites More sharing options...
skippynz Posted February 8, 2006 Share Posted February 8, 2006 not working for me either8)worked ok for me Link to comment Share on other sites More sharing options...
Rick Posted April 23, 2006 Share Posted April 23, 2006 (edited) is it possible to print an .rft or .doc file to default printer??? Edited April 23, 2006 by Rick Who needs puzzles when we have AutoIt!! Link to comment Share on other sites More sharing options...
skippynz Posted April 26, 2006 Share Posted April 26, 2006 is it possible to print an .rft or .doc file to default printer??? yep just change the file open dialog to include the doc extn - see code below - you can also add in rtf files too - default app (ie word) opens up file and then prints the selected file then closes again. #include <File.au3> $file = FileOpenDialog("Print File", "", "Text Documents (*.txt)|Word Documents (*.doc)", 1) If @error Then Exit $print = _FilePrint($file) If $print Then MsgBox(0, "Print", "The file was printed.") Else MsgBox(0, "Print", "Error: " & @error & @CRLF & "The file was not printed.") EndIf Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now