Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formated printing from VB60

Status
Not open for further replies.

jamsek19

Programmer
Feb 4, 2002
35
SI
Hi all.
I want to send some formatted (fontified) text to windows printer directly - not trough any VB controls for example RichTextBox. I want also include some picture in the same printing page.
How can I do that.
Thanks for reply

Andrej
 
In vb (not VBA) there is a printer object. You can do most anything you want via the properties and methods available therein. 'Tis not for the failn of heart, as not only CAN you do most anything - what ever is done, you MUST do it piece-meal. This includes setting the font and it;s attributes, the location (X-Y coordinates) to print, pag margins ...

MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
Hello.
Yes. I use Printer object and I prepare right printer from collection and prepare fontified string to send to printer. And then? How can I use Print method? If I use xObject.Print I got error. Where am I doing wrong?
Thanks
Andrej
 
Andrej,

The Printer IS the object. After setting the printer to the font, size, etc. you want, you would print by coding:

Printer.Print strYourString

or

Printer.Print YourObject

Hope this helps. "It's got to be the going,
not the getting there that's good!"
-Harry Chapin
 
Thanks.
I make:
set p as Printer
set p as Printer
.
.
set right printer from control panel
.
.
p.Print strMyString ...didn't work. But


set p as Printer
.
.
set right printer from control panel
.
.
set Printer = p
Printer.Print strMyString ...work fine

Again. Thanks a lot to all of you
Andrej
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top