Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

getting combo1 from a file

Posted on 2000-05-09
3
Medium Priority
?
242 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:Brendt Hess
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 60 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
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…
Suggested Courses

810 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