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

x
?
Solved

Printing text

Posted on 1998-10-18
6
Medium Priority
?
182 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
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…
Suggested Courses

670 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