Solved

printing text and selected items

Posted on 1998-06-10
3
177 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Excel object stays open 19 76
String manipulation in Visual Basic 7 64
MsgBox 2 57
VB6 - Scroll Mouse wheel on Picturebox 13 44
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…
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 process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

803 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