Solved

Printing text

Posted on 1998-10-18
6
174 Views
Last Modified: 2010-04-30
I wanted to know how I could print text from a textbox like Wordpad prints text. For example if I had a textbox where I typed an essay out. How would I print that textbox so that the essay looks like it was printed by Wordpad or Wordperfect.
0
Comment
Question by:heydes
6 Comments
 
LVL 4

Expert Comment

by:mcix
ID: 1440454
Have you checked out the Rich Text Box Control?

You can do some fairly complicated formatting with it...
0
 
LVL 12

Expert Comment

by:mark2150
ID: 1440455
I have code module avail for RichTextBox that allows changing fonts, alignment, colors, etc and prints accordingly. Contact me direct:

Mark_Lambert@ntsc.navy.mil

if you want program source.

M

0
 

Author Comment

by:heydes
ID: 1440456
I can't use RichText because im working in standard and its not registered. I get a license error when i try to add it onto my form. If you can tell me how i could load it onto my form without buying vb5 enterprise. I'd be happy to give you the points just for that ;) thanks
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
LVL 5

Expert Comment

by:AnswerTheMan
ID: 1440457
NowDays, i don't think that programers have to really program print jobs. for that we have a some powerfull tools we can use.
if i were u - i would make a little database with a MEMO field,
and use one of them tools to make a report based on that database-field.
0
 

Author Comment

by:heydes
ID: 1440458
I was trying to do it old fashion way but thanks
0
 
LVL 3

Accepted Solution

by:
kfrick earned 150 total points
ID: 1440459
Here's the old fashioned way.....

Make a form with a multi-line text box and a command button. Put this code behind the form:

Private Sub Command1_Click()
Dim szTemp As String
Dim szText As String

    szText = Text1.Text
    While Len(szText) > 0
        szTemp = Left$(szText, InStr(szText, Chr$(13) + Chr$(10)) - 1)
        szText = Right$(szText, Len(szText) - (Len(szTemp) + 2))
        Printer.Print szTemp
    Wend
    Printer.EndDoc
End Sub

You can play around with the Printer object for Fonts. You can add a few spaces to the beginning of each line for a fixed margin.
Have fun!

-kf

0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

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…
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…
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…

776 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