Class ContentEditingExtensions
Fluent creation over the DOM primitives: every method appends one node to its natural host and returns the node it created, so calls chain.
Nothing is defaulted into a formatting bag. A paragraph appended here has an empty ParagraphFormat and its runs have no CharacterFormat at all unless one is supplied. That is not tidiness: the bags are sparse, null means "inherit from the style chain", and a helper that wrote a concrete default would both break inheritance and add markup to the saved package that the caller never asked for.
The DOM is not thread-safe and these methods do not make it so. One document is edited by one thread at a time.
public static class ContentEditingExtensions
- Inheritance
-
ContentEditingExtensions
- Inherited Members
Methods
- AppendBookmark(Paragraph, string)
Appends an empty bookmark at the end of a paragraph: a start and end marker with a document-unique id and nothing between them.
- AppendBreak(Paragraph, BreakKind, CharacterFormat?)
Appends a break character to a paragraph.
- AppendHyperlink(Paragraph, string, string, CharacterFormat?, string?)
Appends a hyperlink to an external target: a start marker, one text run and an end marker, plus the external package relationship the target needs.
- AppendImage(Paragraph, byte[], string, Emu, Emu, string?, string?)
Appends an inline picture to a paragraph, adding the image bytes to the document's package and recording the relationship the writer needs.
The bytes are materialized in memory, so the image survives the document being saved more than once and does not depend on any source package staying open.
- AppendInternalHyperlink(Paragraph, string, string, CharacterFormat?, string?)
Appends a hyperlink to a bookmark in the same document. No package relationship is involved: an internal link names its target bookmark directly.
- AppendOleObject(Paragraph, byte[], string, byte[], string, Emu, Emu, bool)
Appends an embedded OLE object to a paragraph: the payload bytes, the preview picture Word actually draws, and the markup that ties them together.
- AppendParagraph(HeaderFooter, string?)
Appends a paragraph to a header or footer.
- AppendParagraph(Note, string?)
Appends a paragraph to a footnote or endnote body.
- AppendParagraph(Section, string?)
Appends a paragraph to a section.
- AppendParagraph(TableCell, string?)
Appends a paragraph to a table cell.
- AppendParagraph(WordDocument, string?)
Appends a paragraph to the document's last section, creating a section when the document has none.
- AppendSection(WordDocument)
Appends an empty section to the document.
- AppendTab(Paragraph, CharacterFormat?)
Appends a tab to a paragraph.
- AppendTable(HeaderFooter, int, int, Twips)
Appends a table to a header or footer.
- AppendTable(Note, int, int, Twips)
Appends a table to a footnote or endnote body.
- AppendTable(Section, int, int, Twips)
Appends a table to a section.
- AppendTable(TableCell, int, int, Twips)
Appends a nested table to a table cell.
- AppendTable(WordDocument, int, int, Twips)
Appends a table to the document's last section, creating a section when the document has none.
- AppendText(Paragraph, string, CharacterFormat?)
Appends a text run to a paragraph.
- AppendToList(Paragraph, int, int)
Makes a paragraph part of an existing numbered or bulleted list.
The paragraph references the concrete NumberingInstance that is already defined; no abstract definition is cloned. Cloning one would start a second counter and the list would restart mid-document.