• Advertisement

Archived

This topic is now archived and is closed to further replies.

VB help with reading from file to combobox

This topic is 6023 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

ok I got a .txt that goes something like this 3 "Name" "other name" "street" 2 1 Well anyway how do you read the "Name" into the combobox because i keep getting all the info to read in instead of just the name.

Share this post


Link to post
Share on other sites
Advertisement
Use a TextStream to read in one line at a time:
In your project, set a reference to Microsoft Scripting Runtime

dim fso as new FileSystemObject
dim ts as TextStream

set ts = fso.OpenTextFile("name", I/O mode etc...)

Do While ts.AtEndOfStream = False
Combo1.AddItem (ts.ReadLine)
Loop

ts.Close


Edited by - noparity on July 23, 2001 12:16:06 PM

Share this post


Link to post
Share on other sites

  • Advertisement