Export docx from RichTextBox

1 posts, 0 answers
  1. Jason
    Jason avatar
    1 posts
    Member since:
    Aug 2012

    Posted 20 Aug 2012 Link to this post

    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? 
Back to Top