Solved

question on printing?

Posted on 2001-06-10
4
126 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

708 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

13 Experts available now in Live!

Get 1:1 Help Now