hi
i want to print simple text from my application .
Printable View
hi
i want to print simple text from my application .
Here is the simplest scenario:
printer.print "This is sample text"
printer.enddoc
how do i create this printer object ... is it an activeX or wat ?
The printer object is a default object in the default vb project. You can easily
change the Font, size, color, position, etc. Just type like previously posted or...
HTHVB Code:
Option Explicit Private Sub Command1_Click() Printer.Font = "Arial" Printer.FontSize = 24 Printer.FontBold = True Printer.ForeColor = vbBlue Printer.Print Tab((Len("My Title") - 80) / 2); "My Title" 'Center the title and print in bold blue text Printer.Print String(80, "-") Printer.FontSize = 12 Printer.FontBold = False Printer.ForeColor = vbBlack Printer.Print "This is some that I printed." Printer.EndDoc 'Send to print spooler for printing. End Sub
Thanks but how do I set the Printer? Do I need to import any class for this?Quote:
Originally Posted by RobDog888
nothing is needed except the printer being online.
I print to a remote printer thru a wireless lan. it works fine.
You can iterate through the Printers collection and set it to one you need if the
one you need is not the default printer.
HTH