Solved

Printing text

Posted on 1998-10-18
6
177 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
[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
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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
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

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

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
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…

732 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