Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
string documentPath = @"C:\sample.docx";
using (Editor editor = new Editor(documentPath))
// Obtain editable document from original DOCX document
EditableDocument editableDocument = editor.Edit();
string htmlContent = editableDocument.GetEmbeddedHtml();
// Pass htmlContent to WYSIWYG editor and edit there...
// Save edited EditableDocument object to some WordProcessing format - DOC for example
WordProcessingSaveOptions saveOptions = new WordProcessingSaveOptions(Formats.WordProcessingFormats.Docx);
editor.Save(editableDocument, @"C:\output\edited.docx", saveOptions);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment