Solved

question on printing?

Posted on 2001-06-10
4
127 Views
Last Modified: 2010-05-02
I would like to ask ,how to do the printing for the vb program?let said I have a form that have to print by the format that I want.thanks you
0
Comment
Question by:leeboonseong
4 Comments
 

Expert Comment

by:TonyS020799
ID: 6175854
Hello leeboonseong,
You have many outdated questions that require your attention before continuing here.  Please ensure to maintain your questions by closing them out and awarding an appropriate grade once a solution has been reached, and constantly keeping experts up to date on your status by leaving comments in your question in response to the experts' posts.  Now, your open questions that require your attention:

http://www.experts-exchange.com/jsp/qShow.jsp?ta=asp&qid=20075729
http://www.experts-exchange.com/jsp/qShow.jsp?ta=asp&qid=20064925
http://www.experts-exchange.com/jsp/qShow.jsp?ta=asp&qid=20033930
http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20123425
http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20127389
http://www.experts-exchange.com/jsp/qShow.jsp?ta=mssql&qid=20015629


Please update these questions.  If they have been answered, award an appropriate grade.  Grading guidelines can be found here:
http://www.experts-exchange.com/jsp/cmtyQuestAnswer.jsp

Note that the experts here help for free.  Many do look at your profile prior to helping.  If they see someone who often gives poor grades, or leaves many questions open and unfinished, it shows them that the questioner has a lack of appreciation for the help they receive here.  The experts will then move on to answer other questions asked by those who do practice good grading habits and show a high appreciation for the free assistance they receive.  Please do your best to maintain your questions from now on.  Failure to do so is grounds for account termination at this site.


TonyS
Community Support Moderator @ Experts Exchange
0
 

Accepted Solution

by:
mhowling earned 50 total points
ID: 6176248
Heres an example of how to print in vb.

Private Sub PrintReport(ReportName as String)
  Dim LoopIndex as Long, Y as Long
  Dim ReportText as String

  ReportText = "THIS IS A TEST LINE "

'begin printing
  Printer.FontSize=14
  DrawText 400,100,ReportName

  Y=200
  'draw 10 lines
  For LoopIndex =1 to 10
    DrawText 400, Y, ReportText & Cstr(LoopIndex)
    Y=Y+Printer.TextHeight("X")
  Next
 'send report to printer
 Printer.EndDoc
End Sub

Private Sub DrawText(X as Long, Y as Long, Text as String)
'a simple routine to print text at a specified location on
'a printed report
  Printer.CurrentX=X
  Printer.CurrentY=Y
  Printer.Print Text;
End Sub

NOTE := The DrawText routine should be expanded to take into consideration linebreaks and word wrapping but this would complicate this example.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7135851
Hi leeboonseong,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will suggest to:

    Accept mhowling's comment(s) as an answer.

leeboonseong, if you think your question was not answered at all or if you need help, you can simply post a new comment here.  Community Support moderators will follow up.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 1

Expert Comment

by:Computer101
ID: 7168353
Comment from expert accepted as answer

Computer101
E-E Moderator
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…

910 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now