Solved

getting combo1 from a file

Posted on 2000-05-09
3
199 Views
Last Modified: 2011-04-14
Hi,
I have a form, called word.frm i have on that form a combo1
and i created a text1. and a command button.

I save to a file named "favo.dat"
with:
(favo.dat exists already and has www.markvt.org in it.)

open "favo.dat" for append as #1
print #1,text1.text
close #1

now my problem:

In favo.dat are the favorite pages of my browser.
i want to open favo.dat and add every rule to combo1

how do i do that ?

points are for the good answer, help me and you get the points.
{The person with the first good answer get the points [!!!]}

mark@markvt.tmfweb.nl



0
Comment
Question by:markyvt
  • 2
3 Comments
 
LVL 32

Expert Comment

by:bhess1
ID: 2794301
This subroutine should do it:

Sub LoadComboBox ()
Dim S as String
Dim Chnl as Integer

Chnl = FreeFile
Open "Favo.dat" for input as #(Chnl)
Do While Not EOF(Chnl)
  Line Input #(Chnl), S
  If S <> "" Then
    Combo1.AddItem S
  End If
Loop
Close #(Chnl)
End Sub
0
 
LVL 4

Accepted Solution

by:
dreamvb earned 15 total points
ID: 2794320
Hello this will work for you

Private Sub Combo1_Click()
 Shell "start.exe " & Combo1.Text, 1
 
End Sub

Private Sub Form_Load()
Dim Filenum As Integer
Dim StrBuffer As String
Filenum = FreeFile
 Combo1.Clear
Open "C:\favo.dat" For Input As #1
 Do While Not EOF(Filenum)
 Input #Filenum, StrBuffer
 Combo1.AddItem StrBuffer
 Loop
 Close #Filenum
 
End Sub
0
 
LVL 4

Expert Comment

by:dreamvb
ID: 2797971
Thanks for the points and hope your program goes well
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
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…

863 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

23 Experts available now in Live!

Get 1:1 Help Now