Solved

save as a file

Posted on 2000-05-01
10
155 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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

758 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

20 Experts available now in Live!

Get 1:1 Help Now