Solved

Loading a file from a list to a Text Box

Posted on 2003-11-10
2
199 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
[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 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

Industry Leaders: 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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…
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…

717 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