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
Solved

question on printing?

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Using "ScreenUpdating" 6 73
VBA Shell can't Find Word document 11 111
VB 6 error 5 in windows 10 but not in XP 7 63
Publisher:   Unknown     VB.exe Application 1 28
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
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…

840 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