473,320 Members | 1,804 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,320 software developers and data experts.

How to save as to a new file.

21
I have a program in visual basic 6 and there are some numbers that I want to save to a file. I have the common dialog now and I can type in a filename and extension, but this is not making the new file.

So my question is, how can I make a file?

Thanks already
Feb 10 '08 #1
4 1683
debasisdas
8,127 Expert 4TB
Try to use FileSystemObject .
Feb 11 '08 #2
lotus18
866 512MB
I have a program in visual basic 6 and there are some numbers that I want to save to a file. I have the common dialog now and I can type in a filename and extension, but this is not making the new file.

So my question is, how can I make a file?

Thanks already
You don't necessarily have to type the file extension. What you need is to filer the file extensions.

CommonmDialog.Filter = "Microsoft Access Database (*.mdb)|*.mdb|All Files " & _
"(*.*)|*.*"
Feb 11 '08 #3
Ali Rizwan
925 512MB
You can use FSO for such purpose.

To create a file you can use following code


Expand|Select|Wrap|Line Numbers
  1. dim fso as new filesystemobject
  2. dim f as file
  3. dim t as textstream
  4.  
  5.  
  6. private sub cmdsave_click()
  7.  
  8. fso.createtextfile(Your Path)
  9.  
  10. set f=fso.getfile(File Path you creates)
  11. set t=f.openastextstream(Select Writing mode)
  12.  
  13. t.write(text1.text)
  14.  
  15. t.close
  16.  
  17. end sub
For further help you can contact me.

Regards
>> ALI <<
Feb 11 '08 #4
I have a program in visual basic 6 and there are some numbers that I want to save to a file. I have the common dialog now and I can type in a filename and extension, but this is not making the new file.

So my question is, how can I make a file?

Thanks already
Dim objFSO As FileSystemObject
Private Sub Command1_Click()
Set objFSO = New FileSystemObject
objFSO.CreateTextFile "C:\testaa.txt"
End Sub
Feb 11 '08 #5

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

Similar topics

0
by: a | last post by:
Save text file as html kloepper 17:42 23 Jul '04 I'm using httpwebresponse and a StringBuilder to return a stream that originates as a file with the .txt suffix (My download code converts the html...
5
by: kevin | last post by:
Hi, Any help with this would be really appreciated! I'm trying to download a file from a remote server. The access permissions is okay but the problem I'm facing is that the file is getting...
4
by: Richard | last post by:
Hi I'm new to ASP/Web programming so any help would be appreciated... Situation: On my web page I would like to present a link {or button} that would allow the user to download a large file. ...
4
by: sunilj20 | last post by:
Hello, I have a requirement wherein, a user clicks on a file name in an ASP.NET web application, and the file should automatically be downloaded (Without showing the "Open", "Save As") in the...
5
by: Patrick | last post by:
Following on from the excellent example at http://www.c-sharpcorner.com/Code/2003/Sept/ExportASPNetDataGridToExcel.asp on how to save a data-grid to excel file, how can I extend the example such...
10
by: GJP | last post by:
Hello. Ive been asked to make my own notepade for college assignment. All ig going well, but i cant get the save to work. I can get Save a (shows dialog box), i can get it to just save too,...
10
by: Henok Girma | last post by:
Hello Gurus, I want to save the state of an unbound DataGridView on my Windows Form application to an XML file so i can later load it back.. Basically, on my form I have a DataGridView, it's got...
1
by: liuliuliu | last post by:
hi -- sorry if this is trivial -- but how do you make a screenshot of a pygame display? i have a surface which is basically the entire visible screen -- how do you write this surface as an image...
3
by: fiefie.niles | last post by:
I would like to save a web page to a file and have the hyperlinks work when I bring the file back up. If the web page has a hyperlink like the following <a href="OurWeb/News/abcFile.htm">, after...
3
by: =?Utf-8?B?YXNkZg==?= | last post by:
Hello. I am making a web application with c# and am using this code: Response.ContentType = "application/x-excel"; Response.AddHeader("Content-Disposition", "attachment;filename=" +...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...

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.