Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 99250

Export rtf to string

$
0
0

Hello,

probably this will be a really simple and stupid question but nevertheless, I am stuck.

 

This is what I tried to do: We store rtf in a database and are planning to use Telerik controls in the future (there is a lot of impressive software inside).

Importing the rtf-text to RichTextEditor is quite easy. I simply put the content of the database field into a string variable and import it into RichtextEditore with this code:

PrivateSubImportRtf()
        Dimprovider AsNewRtfFormatProvider()
        content = CStr(DataGridView.CurrentRow.Cells(xx).Value)
        Me.RadRichTextEditor1.Document = provider.Import(content)
    EndSub

This works perfectly.

After editing the text in RichTextEditor I need to export the new text as rtf to a string to store it in the database. I looked over the documentation and found this:

PublicFunctionExportToRtf(ByValdocument AsRadDocument) AsString
        Dimprovider AsNewRtfFormatProvider()
        Returnprovider.Export(document)
EndFunction

I tried to assign the function's return value to an another string variable:

PrivateSubButton1_Click(sender AsObject, e AsEventArgs) HandlesButton1.Click
        Dimcontent1 AsString= ExportToRtf()
        MsgBox(content1)
EndSub

VisualStudio puts a wiggled blue line under ExportToRtf() and demanded a missing argument for the functions's parameter "document".

Please tell me where my fault is.

Thanks in advance.

P. Arnold


Viewing all articles
Browse latest Browse all 99250

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>