473,405 Members | 2,334 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,405 software developers and data experts.

Open and Save as .txt code in VB6

soramaster
I'm building Jetpad and I don't know the open or save code. Can someone please help me?

thanks
May 19 '07 #1
15 4023
Dököll
2,364 Expert 2GB
I'm building Jetpad and I don't know the open or save code. Can someone please help me?

thanks
Let's see the code in action, soramaster!

In what format do you intend to save this wonderful information?

.txt, .mdb, etc...
May 19 '07 #2
Let's see the code in action, soramaster!

In what format do you intend to save this wonderful information?

.txt, .mdb, etc...

I want it to be able to save it as .txt.

I'm still working on the layout of my program.

This is the stuff I have:
This is the forms:
1.frmWindow
2.mdiMAIN

This is what I have in frmWindow:
1.txtTEXT "a text box"

I have a menu in mdiMAIN

Thanks for the help. If you need any other info let me know and I'll post it
May 19 '07 #3
Dököll
2,364 Expert 2GB
I want it to be able to save it as .txt.

I'm still working on the layout of my program.

This is the stuff I have:
This is the forms:
1.frmWindow
2.mdiMAIN

This is what I have in frmWindow:
1.txtTEXT "a text box"

I have a menu in mdiMAIN

Thanks for the help. If you need any other info let me know and I'll post it
Gotcha!

Save the file to .txt in this fashion:

Expand|Select|Wrap|Line Numbers
  1.  
  2. Open App.Path &"\usermate.txt" For Output As filenum1
  3.  
  4. Open App.Path &"\usermate.txt" For Append As filenum1
  5.  
  6.  
Read the file from .txt in this fashion:

Expand|Select|Wrap|Line Numbers
  1.  
  2. Open App.Path &"\usermate.txt" For Input As filenum1
  3.  
  4.  
  5.  

Have fun!

Dököll
May 19 '07 #4
Gotcha!

Save the file to .txt in this fashion:

Expand|Select|Wrap|Line Numbers
  1.  
  2. Open App.Path &"\usermate.txt" For Output As filenum1
  3.  
  4. Open App.Path &"\usermate.txt" For Append As filenum1
  5.  
  6.  
Read the file from .txt in this fashion:

Expand|Select|Wrap|Line Numbers
  1.  
  2. Open App.Path &"\usermate.txt" For Input As filenum1
  3.  
  4.  
  5.  

Have fun!

Dököll

Ok I have Private Sub FS_Click(Index As Integer)
Open App.Path & "\usermate.txt" For Output As filenum1

Open App.Path & "\usermate.txt" For Append As filenum1
End Sub

FS ="
File
...Save"

I don't know if thats right. When I test it I get a "Run Time error '52': Bad file or number"

I have VB6

Did I put it in the wrong area?
May 19 '07 #5
Dököll
2,364 Expert 2GB
Ok I have Private Sub FS_Click(Index As Integer)
Open App.Path & "\usermate.txt" For Output As filenum1

Open App.Path & "\usermate.txt" For Append As filenum1
End Sub

FS ="
File
...Save"

I don't know if thats right. When I test it I get a "Run Time error '52': Bad file or number"

I have VB6

Did I put it in the wrong area?
You're doing fine, you just need to add:

Expand|Select|Wrap|Line Numbers
  1.  
  2. filenum1 = FreeFile
  3. Private Sub FS_Click(Index As Integer)
  4. Open App.Path & "\usermate.txt" For Output As filenum1
  5. Write #filenum1, Text1.Text 'this being container of text being loaded in usermate.txt
  6. Close #filenum1 ' in your code here to have it do what you want
  7. End Sub
  8.  
May 19 '07 #6
I add a toolbar to my program but how do I add the button images and stuff?
May 20 '07 #7
Dököll
2,364 Expert 2GB
I add a toolbar to my program but how do I add the button images and stuff?
How do you mean?

(1) Your ToolBox is equiped with both Image and PictureBox add ins
(2) Looking up your Image, PictureBox properties, it's pretty standard

Can you tell us a little more?

Have a great week!
May 21 '07 #8
How do you mean?

(1) Your ToolBox is equiped with both Image and PictureBox add ins
(2) Looking up your Image, PictureBox properties, it's pretty standard

Can you tell us a little more?

Have a great week!
This is what I have and I don't have no buttons or images.

Expand|Select|Wrap|Line Numbers
  1.  Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
  2. End Sub
May 21 '07 #9
Ok I figured out how to add the buttons but I can't add any images to them. How do I do that?
May 22 '07 #10
Also I want it to a be able to store the info in the program too if the user selects that option and I want it password protected before you use the program I want it to be able to log the user in with the windows account. How would I be able to make that happen?
May 22 '07 #11
Dököll
2,364 Expert 2GB
Ok I figured out how to add the buttons but I can't add any images to them. How do I do that?
(1) Look your left, find your toolbox,

(2) if you do not have it there, look above your your screen, what looks to be a wrench and a hammer, click on it

(3) Choose PictureBox or Image

(4) Go to either the PictureBox or the Image properties
Clicking once on either will make avaialbel properties pane

(5) Find Image in the list, then hit that little button

(6) Find Photo form your files

Within your code for the command button that'll fire your Image, say:

Expand|Select|Wrap|Line Numbers
  1.  
  2. 'Set visivility to false when form loads
  3. Private Sub Form_Load()
  4.  
  5. Image1.Visible = False
  6.  
  7. End Sub
  8.  
  9. 'Bring snapshot in as needed
  10.  
  11. Private Sub MyPicButton_Click()
  12.  
  13. Image1.Visible = True
  14.  
  15. End Sub
  16.  
  17. Or 
  18.  
  19. Private Sub MyPicButton_Click()
  20.  
  21. Picture1.Visible = True
  22.  
  23. End Sub
  24.  
  25. Depending on which control you are using..
  26.  
  27.  
But, there you have it. I did not try this, but it should work just fine. Please stay tuned if you do not understand.

Also, I would post you code if I were you, you'll find helpful hits/replies that way.

In a bit!
May 23 '07 #12
(1) Look your left, find your toolbox,

(2) if you do not have it there, look above your your screen, what looks to be a wrench and a hammer, click on it

(3) Choose PictureBox or Image

(4) Go to either the PictureBox or the Image properties
Clicking once on either will make avaialbel properties pane

(5) Find Image in the list, then hit that little button

(6) Find Photo form your files

Within your code for the command button that'll fire your Image, say:

Expand|Select|Wrap|Line Numbers
  1.  
  2. 'Set visivility to false when form loads
  3. Private Sub Form_Load()
  4.  
  5. Image1.Visible = False
  6.  
  7. End Sub
  8.  
  9. 'Bring snapshot in as needed
  10.  
  11. Private Sub MyPicButton_Click()
  12.  
  13. Image1.Visible = True
  14.  
  15. End Sub
  16.  
  17. Or 
  18.  
  19. Private Sub MyPicButton_Click()
  20.  
  21. Picture1.Visible = True
  22.  
  23. End Sub
  24.  
  25. Depending on which control you are using..
  26.  
  27.  
But, there you have it. I did not try this, but it should work just fine. Please stay tuned if you do not understand.

Also, I would post you code if I were you, you'll find helpful hits/replies that way.

In a bit!
Well I can't use the program anymore. Something happend and it says it can't find what it needs and it would not load. I tried to uninstall it but it says that the uninstaller is corrupted. So I deleted the VB files "Not the programs, I backed them up" and deleted the VB keys from the regedit and then it showed up as not installed so I clicked next to install and it comes up with an error and won't finish installing. I tried everything. IDK how to get it installed.
May 24 '07 #13
Dököll
2,364 Expert 2GB
Well I can't use the program anymore. Something happend and it says it can't find what it needs and it would not load. I tried to uninstall it but it says that the uninstaller is corrupted. So I deleted the VB files "Not the programs, I backed them up" and deleted the VB keys from the regedit and then it showed up as not installed so I clicked next to install and it comes up with an error and won't finish installing. I tried everything. IDK how to get it installed.
Geez! You must be unhappy...

Try restoring your machine to a date you did not have any problems, perhaps two weeks ago!

See what happens...
May 24 '07 #14
Well its installed but after it starts I keep getting a compnent error is not corectly registerd and other errors.
after I did the restore
May 24 '07 #15
Dököll
2,364 Expert 2GB
Well its installed but after it starts I keep getting a compnent error is not corectly registerd and other errors.
after I did the restore
Have you tried plugging in the error(s) to Microsoft's Knowledge Base page?

Also, Google is pretty good at finding you a match to some errors, you may not be the only one having this problem.

Sorry for your troubles...
May 25 '07 #16

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

Similar topics

4
by: Andras Gilicz | last post by:
Hi VB fans I'm working on a relatively large project in VB6 with about a dozen forms, including graphs, labels, text boxes, etc. The software itself is actually a flow simulator with more or...
3
by: Newbie | last post by:
I am trying to get the save/open dialog figured out. I am able open the save dialog but when I put in a file name (whatever.txt) and save the file does save with the name but it is blank. Below...
3
by: VbUser25 | last post by:
hi.. i have a form i accept some user inputs in the form. there is a link on the form from where i open the excel file in the same browser (not in a new page...simply using a href. i am also...
4
by: John | last post by:
Hi, I generate a report in a comma delimited file and give it a name like MyReport.csv . I then set a Hyperlink control to point tp the file HyperLink1.text = "Download"...
0
by: Dune | last post by:
Hi there, I have an aspx page that allows users to enter several parameters using drop downs and text boxes. The users then press a button that produces an extract based on the parameters they...
6
by: Michael Groeger | last post by:
Hi, I have an aspx page which generates an excel document and transfers it to the browser as attachment. Normally, once the document is transferred the open save dialog prompts to open or save...
3
by: mo | last post by:
I have an application that uses Reporting Services. When the user chooses to print a report, they are taken to a window that allows them to fill in parameters for the report. They then click a...
4
by: Bob Bedford | last post by:
Hi all, I'm stuck with some php code that runs out of time limit. This is due to a long XML file process that has to save pictures on the disk. What I've now: - read XML file - parse XML...
3
by: kev | last post by:
Hi folks, I have a form for registration (frmRegistration) whereby i have two buttons. One is Save which saves record using the OnClick property. I used wizard to create the save button. The...
4
by: nottarealaddress | last post by:
I'm trying to get my feet wet in VB2005 (our new standard at work after officially stopping new development in VB6 about a month ago). I'm working with a simple sql 2005 table of 50 entries, one...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.