473,395 Members | 1,458 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to convert rtf to text

Al
Hi
Is there any what to convert content of a richTexBoxt from rtf to text?
thanks
Al
Nov 21 '05 #1
6 20581
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

Nov 21 '05 #2
Al
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


Nov 21 '05 #3
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


Nov 21 '05 #4
Al
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


Nov 21 '05 #5
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
>
>
>


Nov 21 '05 #6
Al
Thanks Peter

"Peter Proost" wrote:
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
> >
> >
> >


Nov 21 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: hunterb | last post by:
I have a file which has no BOM and contains mostly single byte chars. There are numerous double byte chars (Japanese) which appear throughout. I need to take the resulting Unicode and store it in a...
3
by: Convert TextBox.Text to Int32 Problem | last post by:
Need a little help here. I saw some related posts, so here goes... I have some textboxes which are designed for the user to enter a integer value. In "old school C" we just used the atoi function...
4
by: Serge Klokov | last post by:
Hello! I have a Oracle table with a BLOB field. Each field is actually a simple text file of several lines. How to get this BLOB fields in readable format? I tryied something like...
3
by: Jan Eliasen | last post by:
Hi I have a string, which I must convert into another string and have it utf-8 encoded. My current code looks like this; Both vDataIn and vDataOut are Objects (parameters to a...
10
by: Nikolay Petrov | last post by:
How can I convert DOS cyrillic text to Unicode
5
by: Socrates | last post by:
I am interested in developing an online utility that will enable users to copy and past any image (or upload any image on the internet) to the online utility, which will then convert the image to...
4
by: Edwin Knoppert | last post by:
In my code i use the text from a textbox and convert it to a double value. I was using Convert.ToDouble() but i'm used to convert comma to dot. This way i can assure the text is correct. However...
27
by: comp.lang.tcl | last post by:
My TCL proc, XML_GET_ALL_ELEMENT_ATTRS, is supposed to convert an XML file into a TCL list as follows: attr1 {val1} attr2 {val2} ... attrN {valN} This is the TCL code that does this: set...
3
by: mrajanikrishna | last post by:
Hi Friends, I am accepting a number from the user entered in a textbox. I want to assign to a variable in my code and assignt this to that variable. double num1 = (double)txtNum1.text; ...
0
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.