Solved

Loading a file from a list to a Text Box

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

828 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