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.
smurrayAsked:
Who is Participating?
 
jgravelleConnect With a Mentor Commented:
RichTextBox1.SaveFile "c:\test.rtf", rtfRTF

Change the rtfRTF to rtfText if you wish to save as plain text.
0
 
AzraSoundCommented:
richtextbox has a built in save method

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

richtextbox.loadfile "pathname"
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
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
All Courses

From novice to tech pro — start learning today.