This is a migrated thread and some comments may be shown as answers.

Export docx from RichTextBox

0 Answers 98 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jason
Top achievements
Rank 1
Jason asked on 20 Aug 2012, 08:23 PM
Hi, 
I am trying to import export a document type docx using RichTextBox. My document have tables and Macro check box. When I import using IDocumentFormatProvider and set the layoutMode to FlowNoWrap, the document looks right but all the macro is gone. 
Import code: 
                    IDocumentFormatProvider provider = DocumentFormatProvidersManager.GetProviderByExtension(extension); 
                    using (Stream stream = openDialog.OpenFile()) 
                    { 
                        RadDocument document = provider.Import(stream);
                        document.LayoutMode = DocumentLayoutMode.FlowNoWrap;
                        radRtbEditor.Document = document; 
                    } 

When I export the document from RichTextBox using DocxFormatProvider, all the tables is shrinked to a smaller size (about 1/4 of the document). 
Export Code: 
                    DocxFormatProvider provider = new DocxFormatProvider();
                        using (Stream output = saveDialog.OpenFile())
                        {
                            RadDocument docToExport = radRtbEditor.Document;
                            provider.Export(docToExport, output);
                        }

Could you please tell me if I am missing anything from the code or if this is an known issue of the richTextbox? 
Thanks 
Tags
RichTextBox
Asked by
Jason
Top achievements
Rank 1
Share this question
or