Solved

Printing with VB

Posted on 2000-04-13
5
180 Views
Last Modified: 2010-05-02
How can I print (to printer) with VB6?
I have a GRID or some text with column...

Thanks

Beny
0
Comment
Question by:Beny
  • 3
5 Comments
 

Accepted Solution

by:
andcu earned 50 total points
ID: 2711279
I would pass your info to something like Crystal Reports then print from there.  Or there is a Printer object you can use.
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 2711287
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.
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 2711293
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.
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 2711301
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.
0
 

Expert Comment

by:hatina
ID: 2711786
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



0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question