Skip to content

Instantly share code, notes, and snippets.

@GroupDocsGists
Created September 19, 2019 06:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GroupDocsGists/df88aa892e12c5afe202171bf9da546b to your computer and use it in GitHub Desktop.
Save GroupDocsGists/df88aa892e12c5afe202171bf9da546b to your computer and use it in GitHub Desktop.
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