Link to home
Start Free TrialLog in
Avatar of Beny
Beny

asked on

Printing with VB

How can I print (to printer) with VB6?
I have a GRID or some text with column...

Thanks

Beny
ASKER CERTIFIED SOLUTION
Avatar of andcu
andcu

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The simple method is to use the printer object:

Printer.Print text1.text

Printer.CurrentX = 500
Printer.CurrentY = 1000

Printer.Print "Hello Again"

You can print a grid using something similar to

Printer.PaintPicture DBGrid1.CaptureImage, 100, 100

Then use
Printer.EndDoc

to output the job. Hope this helps.
The simple method is to use the printer object:

Printer.Print text1.text

Printer.CurrentX = 500
Printer.CurrentY = 1000

Printer.Print "Hello Again"

You can print a grid using something similar to

Printer.PaintPicture DBGrid1.CaptureImage, 100, 100

Then use
Printer.EndDoc

to output the job. Hope this helps.
beny, did andcu's answer really help you? If so fair enough, I personally cannot see that there was enough info in his/her response.
Avatar of hatina
hatina

The most easy is using Crystal Report,
where you can define template of your
page at printer.
Crystal Report works only with data from database (I guess,its true too in VB6),but you can save your data in any
temp working database to fulfil it.
The other way ,you must compute and set coordinate in printer , where you will put your texts, or lines (to grid)
There are PRINTER properties SCALE...,
and methods Current.. to do it.

The last way, is use some shareware OCX.
www.geocities.com/ResearchTriangle/6311/ppreview.htm 
for example