Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

printing a text box

Posted on 1998-08-24
9
Medium Priority
?
134 Views
Last Modified: 2010-04-30
How would i go about printing the contents of a textbox named txtmain
0
Comment
Question by:hess
[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
  • 3
  • 2
9 Comments
 
LVL 7

Expert Comment

by:kamall
ID: 1430777
Use the printer object to print the text as shown below:

Printer.Print MyString

MyString is the string to print. Note that the printer object does not wrap text. Therefore, you must read the characters one by one from the text box and use the TextWidth function and compare it with the Printer.ScaleWidth to determine if the line fits on the page width. If not, start a new line.

Hope that helps.
0
 

Author Comment

by:hess
ID: 1430778
This does answer my question but if you could tell me how to find out when the printer is finished i'll give you 15 more pts
0
 
LVL 14

Expert Comment

by:waty
ID: 1430779
printer.print tbYourTextbox.Text

 Print eventually some other textbox


printer.enddocument ' *** Finish the printing document and spool it
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:hess
ID: 1430780
i was hoping that kamall would answer this cause i need to give him some points
0
 
LVL 14

Expert Comment

by:waty
ID: 1430781
One solution is giving 15 points to kamall, and 15 points to me. ;)
0
 

Author Comment

by:hess
ID: 1430782
I guess i can give you 15 points so propose answer and they are yours
0
 
LVL 14

Accepted Solution

by:
waty earned 40 total points
ID: 1430783
printer.print tbYourTextbox.Text

 Print eventually some other textbox


printer.enddocument ' *** Finish the printing document and spool it
0
 
LVL 7

Expert Comment

by:kamall
ID: 1430784
hess,
Sorry for being away for a few days.
I am seeing that you rejected my answer (that was really the answer to your original question) just because you put another question!.
Anyway, if you would like to give me some points, thanks. If not, there is no problem.
Regards.
0
 

Author Comment

by:hess
ID: 1430785
shure, I'll give you some points. There will shortly be a question called "15pts for karmall" and i'll only let you answer it ok.
0

Featured Post

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

721 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