|
-
Jul 18th, 2000, 05:03 AM
#1
Thread Starter
Lively Member
How do you save plain text in a rich text box?
Mag-Net's Home
Visual Studio 6-Enterprise - SP4
ICQ: 35519773
Have Fun 
-
Jul 18th, 2000, 07:13 AM
#2
Frenzied Member
Is this what you want to do?
Code:
Option Explicit
Private Sub Command1_Click()
SavePlainText RichTextBox1, "c:\rawtext.txt"
End Sub
Private Sub SavePlainText(Rtb As RichTextBox, filename As String)
Dim fnum As Byte
fnum = FreeFile
Open filename For Binary As fnum
Put #fnum, , Rtb.Text
Close fnum
End Sub
-
Jul 18th, 2000, 07:31 AM
#3
Hyperactive Member
Mark,
What does your signature mean? I converted it to dec, but I couldnt take anything valuable from doing that?
You have me intrigued.
-
Jul 18th, 2000, 07:38 AM
#4
Frenzied Member
it is just the ascii values for "Mark Sreeves" in binary.
for some reason the spacing goes all weird though.
the digits should of-course be in groups of 8
[Edited by Mark Sreeves on 07-18-2000 at 08:42 AM]
-
Jul 18th, 2000, 08:03 AM
#5
Use SaveFile
A shorter method is to use the built in SaveFile method and pass rtfText as the flag.
Code:
'Pass rtfText as the flag. This tells the RichTextBox to save in plain text.
RichTextBox1.SaveFile "C:\MyFile.txt", rtfText
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|