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

Open Word Document Modify content and Save

1 Answer 971 Views
RichTextEditor
This is a migrated thread and some comments may be shown as answers.
Sunil
Top achievements
Rank 1
Sunil asked on 21 Mar 2018, 07:39 PM

Hi,

I need to open existing word document and  show that document in RadRichTextEditor with extra information (like Name of the person at the top of the document), and also have to add signature and names at the end of the document and save the document. I did using Microsoft.Office.Interop.Word.Document before with DSOFramer control but DSOFramer is having some issues and trying to achieve same using RadRichTextEditor. 

Appreciate your help as soon as possible.

 

thank you!

 

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 23 Mar 2018, 11:44 AM
Hi Sunil,

This is possible with RadRichTextEditor. First, you need to import the document using the format provider: Using DocxFormatProvider. Then you can use the document editor to insert the content. 

The following snippet shows how you can load the document and insert additional content:
DocxFormatProvider provider = new DocxFormatProvider();
using (FileStream inputStream = File.OpenRead(@"..\..\test.docx"))
{
    this.radRichTextEditor1.Document = provider.Import(inputStream);
}
 
var editor = radRichTextEditor1.DocumentEditor;
editor.Insert("John Doe");
editor.InsertParagraph();
 
radRichTextEditor1.Document.CaretPosition.MoveToLastPositionInDocument();
editor.InsertParagraph();
editor.Insert("Signature...........");

Please let me know if there is something else I can help you with. 

Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
RichTextEditor
Asked by
Sunil
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or