Help saving to text file -
I have the following code to save to a text file. I was wondering what I could add to show txt ext when saving and also why it clears my boxes when I save it. Any help would be appreciated.
Private Sub mnuFileSave_Click()
On Error GoTo ErrHandler
'Save to file
Dim intFileNo As Long
Dim strLine As String
Dim i As Long
ReDim strFile(0)
CommonDialog1.ShowSave
intFileNo = FreeFile
Open CommonDialog1.FileName For Output As #intFileNo
Const CRtoken = "|"
Print #intFileNo, Replace(Text1.Text, vbCrLf, CRtoken)
Text1.Text = Replace(strFile(0), CRtoken, vbCrLf)
Print #intFileNo, Replace(Text2.Text, vbCrLf, CRtoken)
Text2.Text = Replace(strFile(0), CRtoken, vbCrLf)
Print #intFileNo, Replace(Text3.Text, vbCrLf, CRtoken)
Text3.Text = Replace(strFile(0), CRtoken, vbCrLf)
Print #intFileNo, Replace(Text4.Text, vbCrLf, CRtoken)
Text4.Text = Replace(strFile(0), CRtoken, vbCrLf)
Print #intFileNo, Replace(Text5.Text, vbCrLf, CRtoken)
Text5.Text = Replace(strFile(0), CRtoken, vbCrLf)
Print #intFileNo, Replace(Text6.Text, vbCrLf, CRtoken)
Text6.Text = Replace(strFile(0), CRtoken, vbCrLf)
Print #intFileNo, Replace(Text7.Text, vbCrLf, CRtoken)
Text7.Text = Replace(strFile(0), CRtoken, vbCrLf)
Print #intFileNo, Replace(Text8.Text, vbCrLf, CRtoken)
Text8.Text = Replace(strFile(0), CRtoken, vbCrLf)
Print #intFileNo, Replace(Text9.Text, vbCrLf, CRtoken)
Text9.Text = Replace(strFile(0), CRtoken, vbCrLf)
Print #intFileNo, Replace(Text10.Text, vbCrLf, CRtoken)
Text10.Text = Replace(strFile(0), CRtoken, vbCrLf)
Print #intFileNo, Replace(Text11.Text, vbCrLf, CRtoken)
Text11.Text = Replace(strFile(0), CRtoken, vbCrLf)
Print #intFileNo, Replace(Text12.Text, vbCrLf, CRtoken)
Text12.Text = Replace(strFile(0), CRtoken, vbCrLf)
Print #intFileNo, Replace(Text13.Text, vbCrLf, CRtoken)
Text13.Text = Replace(strFile(0), CRtoken, vbCrLf)
Print #intFileNo, Replace(Text14.Text, vbCrLf, CRtoken)
Text14.Text = Replace(strFile(0), CRtoken, vbCrLf)
Print #intFileNo, Replace(Text15.Text, vbCrLf, CRtoken)
Text15.Text = Replace(strFile(0), CRtoken, vbCrLf)
Print #intFileNo, Replace(Text16.Text, vbCrLf, CRtoken)
Text16.Text = Replace(strFile(0), CRtoken, vbCrLf)
Combo1.Text = Replace(strFile(0), CRtoken, vbCrLf)
Print #intFileNo, Replace(Combo2.Text, vbCrLf, CRtoken)
Combo2.Text = Replace(strFile(0), CRtoken, vbCrLf)
Print #intFileNo, Replace(Combo3.Text, vbCrLf, CRtoken)
Combo3.Text = Replace(strFile(0), CRtoken, vbCrLf)
Print #intFileNo, Replace(Combo4.Text, vbCrLf, CRtoken)
Combo4.Text = Replace(strFile(0), CRtoken, vbCrLf)
Print #intFileNo, Replace(Combo5.Text, vbCrLf, CRtoken)
Combo5.Text = Replace(strFile(0), CRtoken, vbCrLf)
Print #intFileNo, Replace(Combo6.Text, vbCrLf, CRtoken)
Combo6.Text = Replace(strFile(0), CRtoken, vbCrLf)
Print #intFileNo, Replace(Combo7.Text, vbCrLf, CRtoken)
Combo7.Text = Replace(strFile(0), CRtoken, vbCrLf)
Print #intFileNo, Replace(Combo8.Text, vbCrLf, CRtoken)
Combo8.Text = Replace(strFile(0), CRtoken, vbCrLf)
Print #intFileNo, Replace(Combo9.Text, vbCrLf, CRtoken)
Combo9.Text = Replace(strFile(0), CRtoken, vbCrLf)
Print #intFileNo, Replace(Combo10.Text, vbCrLf, CRtoken)
Combo10.Text = Replace(strFile(0), CRtoken, vbCrLf)
Print #intFileNo, Replace(Combo11.Text, vbCrLf, CRtoken)
Combo11.Text = Replace(strFile(0), CRtoken, vbCrLf)
Close #intFileNo
ErrHandler:
'cancel button
Exit Sub
End Sub
slow file saving -
i have a text box and i have set the text so that if it changes it writes the data from the text box to a file.
the data in the text box is quite large e.50 to 100 lines. and it takes ages to store the data to a file.
is it possible to make the saving of a file quicker?
does a
File Saving -
Ok, I'm not a pro at VB, as most of you know, but I thought I knew file saving. Guess not.
I'm making an HTML editor, and I've got pretty much everything down, except that whenever I save the file it places quotations ( " ) at the beginning and the end of the file. I've tried
File saving blank lines :( -
Ok, my problem is that when saving text files, it adds an extra line of nothing to the end. the basic saving code i use is listed below....
Loading:
stuff = Input(LOF(1), 1)
page(i) = page(i) & stuff
Saving:
Print #1, page(i)
Why every time i update the file, do
How I can optimize saving, opening, calculating in my Excel file -
Hello to all!
I have a such problem: my Excel file is very big. It has big size and a lot of sheets and formulas. But I don’t like that file saving too long (about 10 sec.). I made such research: I copied my program code from each VBA module to one module and delete others. As a re
Word saving a text file -
I am using VB to save a RTF as a text file. The problem is that I loose the formating. We used to have a unix based word perfect program that could take a formated file and save it as a text file, inserting spaces and tabs were they were needed.
Can Word preserve the layout when savin
Saving to a text file.... -
Ok.Im kind of new to visual basic.net and i am making a text editor.
I cant find a peice of code for saving to a file from a textbox.Please help!
reading file saved as db record -
I have ASP code that gives the user the option of saving a file as a file, or saving the file to an Access database.
Saving to a db sounds cool, but how do you reconstitute the file from the record in Access?
oh - and how do you put a link in your signature (pot smokin fro
[2005] passing a large parameter or saving & opening as a text file -
Hello,
I have a selection query i.e. "SELECT * FROM Jobs WHERE customer IN ('','','','').......
That i have to pass as a parameter to the constructor of another form to print a report.
There could be over a hundred customers that could be contained in this query.
I am
saving words from list box to a file question -
Hi!
i have dificulties in saving words from a listbox to a file. The problem is that when i have some words in my file example:
ABC <---1st line in my file
012 <---2nd line in my file
and some words in my listbox example:
DEF
345
when i tried to save
Saving a file -
I'm saving a listbox to a normal Text-File
with a common dialogue.
Now I want, that a message box appears when a
file(name) alredy exists. There, the user can decide,
if he wants to overwright the old file.
How do I program this message box in VB3 ???
Thanks for some help, M
saving to a text file in asp. -
Hiyas, I am saving to text file in asp for append, now that works fine but it is all ending up on the same line, each time something is saved in the text file it is on the same line as the last data sent, and I would like to save each entry on a different line, so i was thinking of att
[2005] Saving to an INI file -
i want to be able to save some data from a text box to an ini files (yes i know xml is better, but I'm just saving plain string texts so i'd rather use ini)
how would i go about doing that?
thanks,
Phil.
Sending a picture without saving it -
Hi,
I want to send a screengrab-picture to another computer.
What I (almost) got working is:
Grabbing the screen into a PictureBox
Saving the screen to BMP file
(converting the BMP to GIF or JPG with a executable shell)
Sending the file with winsock control
But:
saving th
Automate Saving A Datareport to HTML File Format -
hello everyone,
I want to know a DataReport to output an HTML format. What I mean is, how do you avoid user interaction with regards to saving the file? What I mean is creating HTML files from the report, forcing a file name and saving as it were from VB. Is it possible?
Any sugg
Saving the contents of an integer array to an XML file -
Hello all,
I am currently developing a sudoku solver for a project at uni.
At the moment my application saves puzzles as a long text string in a text file.
I have an array of integers (9,9) to represent the puzzle.
Does anyone know how i would go about saving them as an xml
RESOLVED To know when excel is done saving -
Hail,
I am currently experiencing a problem and it seems to be related to excel being in "save mode".
Basically, the application saves an excel file to a server and then saves a text file to the same server. In the meantime, a process from an outside application runs ever
Saving image from text -
This is almost VB related, so here goes. My program needs to combine four image files into one, so it opens them, copies the text into another file, and then "finishes" the file in the new document with "-=done=-". The other part needs to extract this information, a
More ListVeiw woes -
ok First up
I want to get the values and write them to a file but i dont actuall know what is the Vaules like the entries i can read them fine i got that bit saving them its not happening
im saving them to a dat file but i dont actually know what is the data like in normal listbox
Comatose computer while saving temp file -
I have a VB-6 program that records audio for many hours. When the recording is stopped VIA:
‘>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Saving a grid to file -
Can anyone give me any pointers on saving an MSFlexiGrid to a file...thanks
------------------
Import / Export from excel worksheets to text file -
HI GUys,
need a little help with this, I need to transfer multiple cell contents from multiple sheets within a workbbook to a text file, and then be able to import the data back to the relevant cells at a later date.
The cells in question will always be the same ones, but sometim
Saving PDF file as Text file using VB. Net -
Hello:
I am working on an VB. NET application where I need to first save an existing PDF file as text file. Then extract the relevant data from the text file and export that to an Excel workbook.
Is it possible to save a PDF file as text file through VB. NET code?
If it is what
[2005]Saving variables -
i would like to know if there is a way of saving variables to say a text file and loading them
i know how to make a simple text editor and open and save lumps of text but i would like to have it so that if i press a "load" button it asks you to locate the file (normal wind
Saving Info -
Does anyone know a way to save a game file for an rpg? Like, where the player is at in the game and their current stats. You know, just like saving yer game in Zelda. I don't want to save anything to a text file cuz then anyone could just change it...
Saving a file with more lines .. -
hy @ all,
i've got a problem wit saving a file ...
.. i can save a text into a file..
but then in this file is only this text, but i need to have 1 file with at least 4 lines with different texts... Please post example codes!
Bsp:
i've got:
- 1 button
- 4 textboxes
Run-time error '55'; File already in use without any reason :( [resolved] -
Ok i am working on a media player , now saving the playlist works great. The user can add a single file or add files that are in a certain directory.. afterwards saving works great but when they add files from a directory and include the files in the sub directorys the saving failes on
Saving info from a collection -
I have a collection made up of two different classes. I can loop through the collection writing all the information out to a text file for each item in the collection but how can I read the information back off the text file and back into a new collection??
If there is a better way
saving png options -
is there a way to compress the size of a png file? such as maybe saving with only a 2 color palette?
Saving Web Pages -
I don't know if this is possible but I would like to know if it is (and if so how ).
I need some way of saving a web page as an htm file, but also the web page has about 200 links on it to other pages which will also need saving as htm files.
Now I could do this manually (real pa
Saving charts - Excel VBA -
Hey all,
Is there anyway to save a chart, without saving the sheet the chart is on and saving the accompanying source data (sometimes several different sheets)?
Preferably, just saving the chart as .jpg or something similar? Seems like it may be a long shot, but I figured there m
Saving File from server to Client -
hi there,
in my site user upload some files then another user must download it
works fine
but one problem
1) when a user open .txt,.doc files it's not give a saving dialog box but open it in browser
i want then whenever he open any file he get the saving dialog box please
saving setting in a ini file -
I need to save the settings a user defines in my application and they need to be restored the next time the app is run.. saving setting in a ini file
editing text files then re-saving -
I'm trying to write code which will reomve certain lines in a .txt file . For instance if the line begins with any letter, delete it. therefor saving the text which begins with a number.
Im using VB.net
Example: this is what it looks like at first
Date : Jan 31st , Time 15:03 p
Opening Notepad -
Hello everybody,
Please forgive me if this is a simple program. I got into a little bit of VB programming about four years ago, and stopped for awhile and am just now getting back into it.
I am working on a educational program for a friend who is a highschool teacher. I am
Saving a text box contents -
Hello,
When i try to save a RTB contents using rtb.savefile(path) then the file is saved but the contents are disturbed i.e. if it contains a tab space then a "tab" is written the saved file
what is the best way to do the saving
Thank You
Saving multiline text to DB... -
How do I save a multiline's textbox's text to the DB?
Any idea why its not saving the whole text into the db ? Its inserting the first line but only half of the second line. I increased the size if the field in the database and in the parameter definition. Anyway the size of the te
[2005] IIS event log reading through windos service -
Hi all
I have a task of reading the event log of IIS through code and save it inot database as various fileds.
I have been trying to do this by suing the text reader to read the IIS log file (that will be in text format) and then splitting the CSV file to various feilds for sav
saving to a file but not in *.ini format... -
As far as saving information goes, all I know how to do is save information to *.ini files, which is going really good until the other day when I TRIED to make a password saver, but then I realized that even when you don't save the file as a *.ini file, you can still open it in notepad
Update to 2007 ... Solving .DBF problem -
Hey all,
I'm updating my current program to Excel 2007, which was not a big deal, except for the fact that my program must be able to save .DBF files (It's hard to believe MS cut support for .DBF, which is still the most used file in mapping/GIS programs).
I can open the .DBF fi
Another saving question -
Ok, here is what I have this time. I have it saving just not in the manner I want. Basically what I am looking to do is make a backup of an access database. But I dont know how to set the save to take the file that I already have created.
Any ideas?