Solved

question on printing?

Posted on 2001-06-10
4
132 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…
Suggested Courses
Course of the Month6 days, 4 hours left to enroll

627 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