Hi Michael
thank you for your reply - I had found that page but I really needed to go
to text so I kept looking and found I could use a RichText control on the
form ( hidden if necessary ) and then used the following code
System.Windows.Forms.RichTextBox rtfBox; // generated by the rtf
control
// can also just create an "instance" of an RTF as well
string snotes = "";
rtfBox.Rtf = myDR["NOTETEXT"].ToString();
snotes = rtfBox.Text.ToString().Trim();
Console.WriteLine("convert - {0}",snotes); // to have a look
or
if you might havre some non rtf data - eg just text - in the field
try
{
rtfBox.Rtf = myDR["NOTETEXT"].ToString();
snotes = rtfBox.Text.ToString().Trim();
}
catch
{
snotes = myDR["NOTETEXT"].ToString().Trim();
}
I've just tried to find the MS documentation page where I found this but
like everything else - a needle in a haystack - I have favourited it at
the office so will post it later
Peter
Michael Nemtsev said:
Hello Peter,
Smth like this
http://www.codeproject.com/cs/library/nrtftree.asp, google
to find more samples
BTW, you can apply XSLT to transform from RTF to TXT format
PH> Hi all
PH> PH> I'm doing a conversion and I need to convert an RTF field to TXT
.
PH> PH> ie the input field ( read from a SQL table ) using a DataReader
is
PH> in RTF fomat - the output to another system needs to be in Text
PH> format - is there an easy way to remove the formatting and only
PH> leave the text
PH> PH> Thanks
PH> PH> Pete
PH> ---
WBR,
Michael Nemtsev :: blog:
http://spaces.msn.com/laflour
"At times one remains faithful to a cause only because its opponents do
not cease to be insipid." (c) Friedrich Nietzsche