473,382 Members | 1,710 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Saving text files from a listbox

Hello. I have a listbox with various numbers in. I want some code so that when i click the save button it allows me to save the numbers as a text file. I have this code so far but it doesnt save but it does everything else.

saveDialog1.DefaultExt = ".txt"
saveDialog1.OverwritePrompt = True
saveDialog1.Title = "Save File"

If saveDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
Nov 20 '07 #1
3 1446
AHMEDYO
112 100+
Hi..

your code just open savefile Dialog to let user select which file and path to save file in, this operation sure will not never get numbers from your list box and save it to new file, you must open the selected file and then write data to it


Best Regards
Nov 20 '07 #2
how would I do this??
Nov 20 '07 #3
AHMEDYO
112 100+
HI..

first you must loop around all items in the list box, Listbox.itemscount and listbox.list properties will help you to get each item data within your listbox

second, you must open the file selected by the user using FileSystemobject or using Open Keyword and write your data to it


Best Regards
Nov 20 '07 #4

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

Similar topics

0
by: Alpha | last post by:
Hi, I have a listbox and a textbox which is bind to the same dataset's column. So the selected item is display in the textbox availbe for editing. When I change the text in the textbox it has...
4
by: rn5a | last post by:
I have a ListBox which should list all the files & directories that exist in a particular directory. The problem is I can get the ListBox to list either all the files or all the directories but not...
1
by: romcab | last post by:
Hi guys, I would like to ask your help about saving in ado.net. I was able to update it only on the display but when I check the database, it is not updated. I paste below my code and hopefully...
9
by: Yamasassy | last post by:
HI im having problems to saving to a .txt file, i need to be able to store a number of employees to this file (and beable to open and these files to load in to text boxes)and retrieve then for later...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.