Solved

save as a file

Posted on 2000-05-01
10
156 Views
Last Modified: 2010-05-02
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
Comment
Question by:smurray
  • 5
  • 3
  • 2
10 Comments
 
LVL 28

Expert Comment

by:AzraSound
ID: 2766626
richtextbox has a built in save method

richtextbox.savefile "pathname"
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 2766630
likewise, it has a loadfile method

richtextbox.loadfile "pathname"
0
 
LVL 1

Accepted Solution

by:
jgravelle earned 100 total points
ID: 2766686
RichTextBox1.SaveFile "c:\test.rtf", rtfRTF

Change the rtfRTF to rtfText if you wish to save as plain text.
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 2766704
jgravelle...work on your comment posting techniques
0
 

Author Comment

by:smurray
ID: 2766719
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 28

Expert Comment

by:AzraSound
ID: 2766729
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
 
LVL 1

Expert Comment

by:jgravelle
ID: 2766732
azrasound..it doesn't look like your technique is much better.
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 2766747
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
 
LVL 1

Expert Comment

by:jgravelle
ID: 2766777
I apologize azrasound...I thought I was posting a comment.
0
 

Author Comment

by:smurray
ID: 2792789
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now