|
-
Sep 5th, 2005, 05:30 PM
#1
Thread Starter
Hyperactive Member
Saving text that is centered(resolved)
Hello friends,
I've got a problem with my save methods, they are not working correctly. I have a rich text box where I can have text in and then center it, but when I save and open it back up, the text is not centered... here is my code
VB Code:
strSave2 = txtFinalTab.Text
cdlSave.DefaultExt = ".txt"
cdlSave.Filter = "Text (*.txt)|*.txt|Word document (*.doc)|*.doc|Rich Text(*.rtf)|*.rtf"
cdlSave.ShowSave
strSave = cdlSave.FileName
If cdlSave.FileName = "" Then
Exit Sub
End If
Open strSave For Output As #1
Print #1, strSave2
Close #1
Last edited by shizzy; Sep 5th, 2005 at 06:08 PM.
-
Sep 5th, 2005, 05:40 PM
#2
Re: Saving text that is centered
Thats because the richtextbox has its own save method, and its own read method. Try those two instead of the regular .txt way
-
Sep 5th, 2005, 05:45 PM
#3
Thread Starter
Hyperactive Member
Re: Saving text that is centered
Well i'm not sure exactly how to use the rtb save method, so maybe you can show me?
-
Sep 5th, 2005, 05:48 PM
#4
Re: Saving text that is centered
Maybe this?
VB Code:
RichTextBox1.LoadFile "C:\somefile.rtf"
'and
RichTextBox1.SaveFile "C:\somefile.rtf"
-
Sep 5th, 2005, 06:08 PM
#5
Thread Starter
Hyperactive Member
Re: Saving text that is centered
-
Sep 5th, 2005, 06:16 PM
#6
Re: Saving text that is centered(resolved)
No problem
-
Sep 5th, 2005, 07:26 PM
#7
Re: Saving text that is centered(resolved)
You can save as text or rtf
VB Code:
Private Sub cmdSaveFile_Click()
rtb.SaveFile App.Path & "\save.rtf", 0 ' 0=RTF 1=TEXT
End Sub
-
Sep 5th, 2005, 07:39 PM
#8
Re: Saving text that is centered(resolved)
 Originally Posted by dglienna
You can save as text or rtf
VB Code:
Private Sub cmdSaveFile_Click()
rtb.SaveFile App.Path & "\save.rtf", 0 ' 0=RTF 1=TEXT
End Sub
A nice addition!
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
|