Sign in to follow this  
Followers 0
cppman

Printers

9 posts in this topic

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.

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

yeah... i tried that earlier but it was'nt "Printing" for me. thanks, and sry to take ur time.

great minds think alike - hahaha

Share this post


Link to post
Share on other sites

not working for me either

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

not working for me either

8)

worked ok for me

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

is it possible to print an .rft or .doc file to default printer???

Edited by Rick

Who needs puzzles when we have AutoIt!!

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0