Hi All,
I've a very simple problem. When i convert simple text into RTF in a class it doesnt work but whne I see the result in immeidate window I'm able to see the actual result. Why is this difference Please see the below code and its very simple and starightforward but I'm struggling to findout the root cause.
Dim
objData As New DataObject(strText)Clipboard.SetDataObject(objData)
Dim reverdata As New DataObjectreverdata = Clipboard.GetDataObject()
'now get the new object If Not reverdata Is Nothing Then strRichText = reverdata.GetData("Rich Text Format", True) End Ifwhen i see the value of reverdata.GetData("Rich Text Format", True) in immediate window I'm able to see RTF string but when I run the program I get nothing in strRichText variable.
Any thoughts I'm using 1.1 framework.
Cheers,
Rama

in Immeidate window it works but not on class- RTF-clipborad
GroZZleR
Hi All,
Can anyone help me
Jignesh Vyas
Hi nobugz,
Thanks a lot. its working fine.
Cheers,
Rama
grhomm
public static string ConvertText2Rtf(string txt) {
using (RichTextBox rtb = new RichTextBox()) {
rtb.Text = txt;
return rtb.Rtf;
}
}