Hi Al,
this is what I showed you in the previous post I think,
place a richtextbox and a button on a form then copy paste this code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As _
System.EventArgs) Handles Button1.Click
RichTextBox1.Rtf =
"{\rtf1\ansi\ansicpg1252\deff0\deflang1043{\fonttb l{\f0" & _
"\fnil\fcharset0 Microsoft Sans Serif;}}\viewkind4\uc1\pard\f0\fs17 test
hallo\par}"
Dim objWriter As New StreamWriter("c:\test.txt")
objWriter.WriteLine(RichTextBox1.Text)
objWriter.Close()
End Sub
I hope this helps you
greetz Peter
"Al" <Al@discussions.microsoft.com> wrote in message
news:34**********************************@microsof t.com...
Hi Peter,
sorry for not describing what i want better. Yes richtextbox.rtf showes
rtf string as a text but I need to read a string formated as rtf and then
convert it to text write to a file as text without any formating.
thanks
Al
"Peter Proost" wrote:
Sorry If I don't get it but
RichTextBox1.Rtf ==> Gives the text and the formatting characters
RichTextBox1.Text ==> Just gives the text in the richtextbox
if you pass a rtf string to the richtextbox.rtf it will only show the
text:
for example:
RichTextBox1.Rtf =
"{\rtf1\ansi\ansicpg1252\deff0\deflang1043{\fonttb l{\f0\fnil\fcharset0 _
Microsoft Sans Serif;}}\viewkind4\uc1\pard\f0\fs17 test hallo\par}"
hth
Greetz Peter
"Al" <Al@discussions.microsoft.com> wrote in message
news:2B**********************************@microsof t.com... No, RichTextBox1.Text will be empty eventhough RichTextBox1.rtf is
not.
"Peter Proost" wrote:
> Hi,
>
> Doesn't RichTextBox1.Text work for you?
>
> Greetz Peter
>
>
> "Al" <Al@discussions.microsoft.com> wrote in message
> news:DE**********************************@microsof t.com...
> > Hi
> > Is there any what to convert content of a richTexBoxt from rtf to
text? > > thanks
> > Al
>
>
>