Solved

Loading a file from a list to a Text Box

Posted on 2003-11-10
2
196 Views
Last Modified: 2010-05-03
How do you load a file from a List box to a text box.

I'm using Microsoft Direct Text-to-Speech and it wont speak from the list box but it will from the text box.
The file is loaded to the list box from the C drive.

So how is this possible???
0
Comment
Question by:Reachtabhair
2 Comments
 
LVL 7

Expert Comment

by:_agj_
ID: 9714784
loading meaning?

if u just want the listbox text to be loaded in the text box, do a

text1.text = list1.text

or

text1.text = list1(list1.index)

if u want to load the file whose name is in the listbox to the textbox then:

dim var
open list1.text for input as #1

input #1, var

close #1

text1.text  = var

Or

dim str1 as string
open list1.text for input as #1

text1.text = ""

while not eof(1)
line input #1, str1
text1.text = text1.text & str1
wend

close #1



0
 
LVL 1

Accepted Solution

by:
Shaztronics earned 50 total points
ID: 9719972
Dim counter
counter = 0
Do until counter = list1.listcount
Text1.text = Text1.text & List1.list(counter) & vbcrlf
Loop
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

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

786 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