Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saving rich text files with bullets causes problem

Status
Not open for further replies.

tahsoft

Programmer
May 3, 2004
1
0
0
US
Using: Visual Basic 5.0 SP3

Please try this sample (code is listed below to make this easy for you) and see if you get the same problem. I can't figure it out.

Rich text box (default name)
3 command buttons named cmdSave cmdLoad and cmdBullet

When I put bullets in with a line break after the bullets and save the file and then load the file it something like this:

----------------------
sample text

* asdfasdf
* asdfasdf
* asdfasdf
.

sample text
----------------------

then if i save it again and reload it:

----------------------
sample text

* asdfasdf
* asdfasdf
* asdfasdf
. .

sample text
----------------------
The dots grow with every save and load.

This is driving me mad. Is this a problem with my computer or the MS rich text box?
richtx32.ocx is version 6.0.84.18
riched32.dll is version 5.0.2134.1

Do these files need to be different versions?

Thank you for your help.

--------------------------------------------
Private Sub cmdBullet_Click()
If RichTextBox1.SelBullet = False Then
RichTextBox1.SelBullet = True
Else
RichTextBox1.SelBullet = False
End If
End Sub

Private Sub cmdLoad_Click()
RichTextBox1.LoadFile "C:\test.rtf", rtfRTF
End Sub

Private Sub cmdSave_Click()
RichTextBox1.SaveFile "C:\test.rtf", rtfRTF
End Sub
 

No problems here with VB6.0 SP5 using the RTB from SP4.

Good Luck

 
Suggestion,

Why not handle open and save's yourself using either
the "open" statement or the commondialog ocx.

RTF is the same as plain text, but with a lot of
formatting.
So saving rtf as text with rtf formatting would work just as fine.

[ponder]KrK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top