[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

display info from listbox

Posted on 2006-04-25
1
Medium Priority
?
146 Views
Last Modified: 2010-05-01
hello,
I have a listbox and I would like to display just the emails from a .txt file that contains this

email1@domain.com;password1
email2@domain.com;password2
email3@domain.com;password3

how can I do that?
0
Comment
Question by:aplelois
1 Comment
 
LVL 43

Accepted Solution

by:
TimCottee earned 2000 total points
ID: 16533441
Hi aplelois,

Private Sub Command2_Click()
    Dim lngFHandle As Long
    lngFHandle = FreeFile()
    Open "MyInputFile.txt" For Input As #lngFHandle
    Do
        Line Input #lngFHandle,strLine
        List1.AddItem Split(strLine,";")(0)
    Loop Until Eof(lngFHandle)
    Close #lngFHandle
End Sub

Will do it.

Tim Cottee
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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 process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

865 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