Solved

Printing with VB

Posted on 2000-04-13
5
179 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

778 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