This is a migrated thread and some comments may be shown as answers.
Paste editor to word document
1 Answer 10 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Herman asked on 14 May 2012, 01:33 PM
I use this code to display html text from sql database in rad editor now i want to paste the text with the color , bold to word document.
The words paste normal as text not with any colors or bold text just plain texted

This is the code what i use.
Paragraph heading3 = new Paragraph();
                                    Run heading_run3 = new Run();
                                    Text heading_text3 = new Text(name);
                                    ParagraphProperties heading_pPr3 = new ParagraphProperties();
                                    // we set the style
                                    heading_pPr3.ParagraphStyleId = new ParagraphStyleId() { Val = "Heading" + num.ToString() };

                                    if (CheckBox1.Checked == true)
                                            ///Add Proposal Description to Document
                                            string html2 = drvSql["Sales_Description"].ToString();
                                            //string id = drvSql["Treeselectedid"].ToString();
                                            RadEditor2.Content = html2;
                                            string t;

                                            StringWriter sw = new System.IO.StringWriter();

                                            t = RadEditor2.Text;
                                            Paragraph heading2 = new Paragraph();
                                            Run heading_run2 = new Run();
                                            Text heading_text2 = new Text(t);
                                            ParagraphProperties heading_pPr2 = new ParagraphProperties();
                                            //// we set the style
                                            heading_pPr2.ParagraphStyleId = new ParagraphStyleId() { Val = "Indent" + num.ToString() };

1 Answer, 1 is accepted

Sort by
Telerik team
answered on 17 May 2012, 12:10 PM

The content area of RadEditor is a standard editable IFRAME/DIV element. The copy process is entirely controlled by the browser and RadEditor cannot modify the copied content, because it is not possible to modify it with JavaScript.

If you would like you can insert the server code via the Format Code Block tool which is convert it to HTML and you can copy the formatted content and paste it in Word with its formatting.

Best regards,
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question