Solved

printing text and selected items

Posted on 1998-06-10
3
175 Views
Last Modified: 2010-05-18
im working on a program that has 2 list boxes and a text box and a command button the first list box multiselect is set to extended i would like to know how to copy just the selected items from the first list box and add them to the second list box with the command button and would like to know how to print wordwraped text from the text box ive tryed printer.print text1.text but it only prints the first line off the page
0
Comment
Question by:440
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
KEWL earned 60 total points
ID: 1463051
Create a Rich Text Box control, and use this code:

Richtext1.text = text1.text
richtext1.selprint
printer.enddoc

:)
all yours
0
 
LVL 1

Expert Comment

by:Edithf
ID: 1463052
For your question on selecting items in te listbox do the following

    If List1.ListIndex <> -1 Then
        For i = 0 To List1.ListCount - 1
            If List1.Selected(i) Then List2.AddItem List1.List(i)
        Next i      
    End If

You should change the textbox properties (Set MultiLine to True) and then in do the  
        Printer.Print Text1.Text
        Printer.EndDoc

Hope that help :)

I was going to post it as an answer but someone is a bit earlier than me. Anyway....
0
 
LVL 1

Expert Comment

by:Edithf
ID: 1463053
shouldn't I be awarded some points
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…

867 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now