Method Save
- Namespace
- DocWright
- Assembly
- DocWright.dll
Save(WordDocument, Stream, string, SaveOptions?)
Saves a document back to a word-processing format, chosen by file extension.
Routed through FormatRegistry so a host-registered writer is reachable exactly the way a host-registered reader is. Saving is distinct from Convert(WordDocument, Stream, ConvertOptions?): converting renders the document to PDF, while saving round-trips it in an editable format, preserving everything the source carried.
public void Save(WordDocument document, Stream output, string extension = ".docx", SaveOptions? options = null)
Parameters
documentWordDocumentThe document to save.
outputStreamThe writable stream that receives the package bytes.
extensionstringThe target extension, for example ".docx".
optionsSaveOptionsThe save options, or null for defaults.
Exceptions
- ArgumentNullException
documentoroutputis null.- ArgumentException
outputis not writable, or the extension is empty.- UnsupportedFeatureException
No writer is registered for the extension.