Solved

Loading a file from a list to a Text Box

Posted on 2003-11-10
2
192 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_
Comment Utility
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
Comment Utility
Dim counter
counter = 0
Do until counter = list1.listcount
Text1.text = Text1.text & List1.list(counter) & vbcrlf
Loop
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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 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…

728 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

13 Experts available now in Live!

Get 1:1 Help Now