Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 165
  • Last Modified:

save as a file

I would like to save the contants of a richtextbox that im using to capture data from an external source via the comm port. I want the file to open when I click the capture button and close when I click another. Also the file will be saved as a date so 5199.log. I have the date format and comm port working its just the file open/save. I also dont want the commondialog to appear.
0
smurray
Asked:
smurray
  • 5
  • 3
  • 2
1 Solution
 
AzraSoundCommented:
richtextbox has a built in save method

richtextbox.savefile "pathname"
0
 
AzraSoundCommented:
likewise, it has a loadfile method

richtextbox.loadfile "pathname"
0
 
jgravelleCommented:
RichTextBox1.SaveFile "c:\test.rtf", rtfRTF

Change the rtfRTF to rtfText if you wish to save as plain text.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
AzraSoundCommented:
jgravelle...work on your comment posting techniques
0
 
smurrayAuthor Commented:
What I would like is to open the file and gather all information and then after 30 minutes close the file but if by chance the user exits without closing all data up till then will still be kept.
0
 
AzraSoundCommented:
then in the forms Unload event just do a save

richtextbox.savefile "C:\5199.log", 1

this will ensure it is saved before the app ends
0
 
jgravelleCommented:
azrasound..it doesn't look like your technique is much better.
0
 
AzraSoundCommented:
the point is your answer is the same as my comment, if you havent noticed, it is the general procedure to post comments at this site, especially when your answer is just a recap of a previously posted comment.
0
 
jgravelleCommented:
I apologize azrasound...I thought I was posting a comment.
0
 
smurrayAuthor Commented:
Is there a way to poll all the data at startup of the device. I want to open the file. Turn on the system and capture everything during the boot and once compleate close it. Any thoughts?
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 5
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now