Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Printing individual items in a list box

Posted on 2001-06-26
2
Medium Priority
?
161 Views
Last Modified: 2010-05-02
Hello. This is a basic question, I'm sure. I am trying to print to a sequential file the individual items that I have selected from a list box. So far I have only been able to get the index number of the items to print, not the actual name of the item. How can I print the actual name of the list items when they are selected? Thanks.
0
Comment
Question by:Ahobs
[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
2 Comments
 
LVL 3

Accepted Solution

by:
Hornet241 earned 200 total points
ID: 6229204
try this

ff = FreeFile
Open "C:\YourFileName.Ext" for Output as #ff

For a = 0 to List1.Listcount - 1
    If List1.Selected(a) Then
        Print #ff, List1.List(a)
    End If
Next a

Close #ff
0
 

Author Comment

by:Ahobs
ID: 6229268
Thanks for the speedy reply. It works!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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 …
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

636 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