By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,529 Members | 864 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,529 IT Pros & Developers. It's quick & easy.

Writing combo box to text file

jamesd0142
100+
P: 469
Hi again!

I have a combo box called cboFavourites.

How can i write all the items in this combo box to a text file?

Also

How can i read all the contents from the text file to the combo box?

Thanks James
Sep 21 '07 #1
Share this Question
Share on Google+
2 Replies


QVeen72
Expert 100+
P: 1,445
Hi,

use "File System Objects" or "Open" file statement to access Text Files.

REgards
Veena
Sep 21 '07 #2

hariharanmca
100+
P: 1,977
I think this will help you.

Ex 1:
Expand|Select|Wrap|Line Numbers
  1.     Open App.Path & "\SampleText.txt" For Output As #1
  2.         Print #1, "Print Line One"
  3.         Print #1, "Print Line Two" 
  4.         Print #1,  "Print Line Three"
  5.  
  6.         Print #1,  "Print Line N"
  7.     Close #1
Ex 2 :
Expand|Select|Wrap|Line Numbers
  1.     Open App.Path & "\SampleText.txt" For Input As #1
  2.         Input #1, strReadLine1
  3.         Input #1, strReadLine2
  4.         Input #1, strReadLine3
  5.  
  6.         Input #1, strReadLineN
  7.     Close #1
Ex 3 :
Expand|Select|Wrap|Line Numbers
  1.     Dim strReadLine() As String
  2.     Dim i As Integer
  3.     Open App.Path & "\SampleText.txt" For Input As #1
  4.         While EOF(1)
  5.               ReDim strReadLine(i) As String
  6.               Input #1, strReadLine(i)
  7.               i = i + 1
  8.         Wend
  9.     Close #1
Sep 21 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.