Skip to main content

SubDocument Members

Exposes properties and methods representing essential document functionality.

Properties

Name Description
Bookmarks Provides access to the collection of document bookmarks.
Comments Provides access to a collection of comments in the current SubDocument.
ContentControls Obtains content controls obtained in a document.
CustomMarks Provides access to a collection of custom marks.
Fields Provides access to the collection of fields in the current document.
FormFields Provides access to the collection of the document’s FormField objects.
Hyperlinks Provides access to a collection of hyperlinks in the document.
Images Provides access to the collection of all images (inline and floating pictures) in the document .
Length Gets the character length of the document.
PageBackColor Gets the background color of the page.
Paragraphs Provides access to a collection of paragraphs.
Range Gets the range for the current document.
Shapes Returns the collection of drawing objects in the document.
ShowPageBackground Gets whether the page background color is shown.
Tables Provides access to a collection of tables contained in the current document.

Methods

Name Description
AppendDocumentContent(DocumentRange, InsertOptions) Appends content from the specified range.
AppendDocumentContent(DocumentRange) Appends content from the specified range.
AppendDocumentContent(Stream, DocumentFormat, String, InsertOptions) Appends content from the stream.
AppendDocumentContent(Stream, DocumentFormat, String) Appends content from the stream.
AppendDocumentContent(Stream, DocumentFormat) Appends content from the stream.
AppendDocumentContent(Stream) Appends content from stream.
AppendDocumentContent(String, DocumentFormat, String, InsertOptions) Appends content from the file.
AppendDocumentContent(String, DocumentFormat, String) Appends content from the file.
AppendDocumentContent(String, DocumentFormat) Appends content from the file.
AppendDocumentContent(String) Appends content from the file.
AppendHtmlText(String, InsertOptions) Appends HTML formatted text.
AppendHtmlText(String) Appends HTML formatted text.
AppendRtfText(String, InsertOptions) Appends formatted text.
AppendRtfText(String) Appends formatted text.
AppendSingleLineText(String) Appends text as a single line.
AppendText(String) Appends the specified text.
ApplySyntaxHighlight(List<SyntaxHighlightToken>) Performs a batch update of text formatting for document ranges corresponding to specified tokens.
BeginUpdate() Locks the SubDocument object. Prevents visual updates until the EndUpdate method calls.
BeginUpdateCharacters(DocumentPosition, Int32) Starts modifying properties of the specified number of characters starting at the specified document position.
BeginUpdateCharacters(DocumentRange) Starts modifying properties of characters that fall within a specified document range.
BeginUpdateCharacters(Int32, Int32) Starts modifying properties of the specified number of characters starting at the specified document position.
BeginUpdateParagraphs(DocumentRange) Starts modifying properties of the paragraphs that fall within a specified document range.
BeginUpdateRangePermissions() Gets the collection of all range permissions in the current document.
CancelUpdateRangePermissions(RangePermissionCollection) Finalizes the update process, leaving range permissions intact.
CreatePosition(Int32) Creates a new position in the current document.
CreateRange(DocumentPosition, Int32) Creates a new document range using the specified start position and range length.
CreateRange(Int32, Int32) Creates a new document range using the specified start position and range length.
Delete(DocumentRange) Removes content from the specified range.
EndUpdate() Unlocks the SubDocument object after you call BeginUpdate. It also causes an immediate visual update.
EndUpdateCharacters(CharacterProperties) Finalizes the modification of character formatting after calling the SubDocument.BeginUpdateCharacters method.
EndUpdateParagraphs(ParagraphProperties) Finalizes the modification of paragraph formatting after the BeginUpdateParagraphs method call.
EndUpdateRangePermissions(RangePermissionCollection) Finalizes the update and applies the changes to range permissions.
FindAll(String, SearchOptions, DocumentRange) Finds all text ranges that match the specified string in the specified document range.
FindAll(String, SearchOptions) Finds all text ranges that match the specified string in the specific part of the document (main body, text box, header, footer, comment, footnote, and endnote).
FindAll(Regex, DocumentRange) Finds all occurrences of a character pattern specified by the regular expression.
FindAll(Regex) Finds all occurrences of a character pattern specified by the regular expression.
GetDocBytes(DocumentRange, DocDocumentExporterOptions) Exports the range content in DOC (Microsoft Word 97-2003 Document) format and returns a byte array with this content.
GetDocBytes(DocumentRange) Exports the range content in DOC (Microsoft Word 97-2003 Document) format and returns a byte array with this content.
GetDocmBytes(DocumentRange, DocmDocumentExporterOptions) Exports the range content in DOCM (Microsoft Office Open XML Macro-Enabled Document) format and returns a byte array with this content.
GetDocmBytes(DocumentRange) Exports the range content in DOCM (Microsoft Office Open XML Macro-Enabled Document) format and returns a byte array with this content.
GetDotBytes(DocumentRange, DotDocumentExporterOptions) Exports the range content in DOT (Microsoft Word 97-2007 Template) format and returns a byte array with this content.
GetDotBytes(DocumentRange) Exports the range content in DOT (Microsoft Word 97-2007 Template) format and returns a byte array with this content.
GetDotmBytes(DocumentRange, DotmDocumentExporterOptions) Exports the range content in DOTM (Microsoft Office Open XML Macro-Enabled Template) format and returns a byte array with this content.
GetDotmBytes(DocumentRange) Exports the range content in DOTM (Microsoft Office Open XML Macro-Enabled Template) format and returns a byte array with this content.
GetDotxBytes(DocumentRange, DotxDocumentExporterOptions) Exports the range content in DOTX (Microsoft Office Open XML macro-free template) format and returns a byte array with this content.
GetDotxBytes(DocumentRange) Exports the range content in DOTX (Microsoft Office Open XML macro-free template) format and returns a byte array with this content.
GetFlatOpcBytes(DocumentRange, FlatOpcDocumentExporterOptions) Exports the range content in FlatOpc (Microsoft Word XML Document, .xml) format and returns a byte array with this content.
GetFlatOpcBytes(DocumentRange) Exports the range content in FlatOpc (Microsoft Word XML Document, .xml) format and returns a byte array with this content.
GetFlatOpcMacroEnabledBytes(DocumentRange, FlatOpcMacroEnabledDocumentExporterOptions) Exports the range content in FlatOpcMacroEnabled (Microsoft Word XML Macro-Enabled Document, .xml) format and returns a byte array with this content.
GetFlatOpcMacroEnabledBytes(DocumentRange) Exports the range content in FlatOpcMacroEnabled (Microsoft Word XML Macro-Enabled Document, .xml) format and returns a byte array with this content.
GetFlatOpcMacroEnabledTemplateBytes(DocumentRange, FlatOpcMacroEnabledTemplateDocumentExporterOptions) Exports the range content in FlatOpcMacroEnabledTemplate (Microsoft Word XML Macro-Enabled Template, .xml) format and returns a byte array with this content.
GetFlatOpcMacroEnabledTemplateBytes(DocumentRange) Exports the range content in FlatOpcMacroEnabledTemplate (Microsoft Word XML Macro-Enabled Template, .xml) format and returns a byte array with this content.
GetFlatOpcTemplateBytes(DocumentRange, FlatOpcTemplateDocumentExporterOptions) Exports the range content in FlatOpcTemplate (Microsoft Word XML Template, .xml) format and returns a byte array with this content.
GetFlatOpcTemplateBytes(DocumentRange) Exports the range content in FlatOpcTemplate (Microsoft Word XML Template, .xml) format and returns a byte array with this content.
GetHtmlText(DocumentRange, IUriProvider, HtmlDocumentExporterOptions) Gets the text contained in the specified range in HTML format.
GetHtmlText(DocumentRange, IUriProvider) Gets the text contained in the specified range in HTML format.
GetMhtText(DocumentRange, MhtDocumentExporterOptions) Gets the content of the specified document range in MHT format.
GetMhtText(DocumentRange) Gets the content of the specified document range in MHT format.
GetOpenDocumentBytes(DocumentRange, OpenDocumentExporterOptions) Exports the content of the specified document range as a document in Open Document (ODT) format and returns a byte array with this document.
GetOpenDocumentBytes(DocumentRange) Exports the content of the specified document range as a document in Open Document (ODT) format and returns a byte array with this document.
GetOpenXmlBytes(DocumentRange, OpenXmlDocumentExporterOptions) Exports the content of the specified document range as a document in Office Open XML (Docx) format and returns a byte array with this document.
GetOpenXmlBytes(DocumentRange) Exports the content of the specified document range as a document in Office Open XML (Docx) format and returns a byte array with this document.
GetRtfText(DocumentRange, RtfDocumentExporterOptions) Gets the formatted string of the text contained in the specified range.
GetRtfText(DocumentRange) Gets the formatted string of the text contained in the specified range.
GetSubDocumentType() Returns the subdocument type.
GetText(DocumentRange, TextFragmentOptions) Returns the plain text of the specified document range.
GetText(DocumentRange, PlainTextDocumentExporterOptions, TextFragmentOptions) Returns the plain text of the specified document range.
GetText(DocumentRange, PlainTextDocumentExporterOptions) Returns the plain text of the specified document range.
GetText(DocumentRange) Returns the plain text of the specified document range.
GetWordMLText(DocumentRange, WordMLDocumentExporterOptions) Gets the text contained in the specified range in WordML format.
GetWordMLText(DocumentRange) Gets the text contained in the specified range in WordML format.
InsertDocumentContent(DocumentPosition, DocumentRange, InsertOptions) Inserts content from the specified range in the current document at the specified position.
InsertDocumentContent(DocumentPosition, DocumentRange) Inserts content from the specified range in the current document at the specified position.
InsertDocumentContent(DocumentPosition, Stream, DocumentFormat, InsertOptions) Inserts content from the specified stream in the specified format, at the specified position, in the current document.
InsertDocumentContent(DocumentPosition, Stream, DocumentFormat, String, InsertOptions) Inserts content from the specified stream in the specified format, at the specified position, in the current document.
InsertDocumentContent(DocumentPosition, Stream, DocumentFormat, String) Insert content from the stream in the current document at the specified position.
InsertDocumentContent(DocumentPosition, Stream, DocumentFormat) Inserts content from the stream in the current document at the specified position.
InsertDocumentContent(DocumentPosition, Stream) Inserts content from the stream in the current document at the specified position.
InsertDocumentContent(DocumentPosition, String, DocumentFormat, InsertOptions) Inserts content from the file in the current document at the specified position.
InsertDocumentContent(DocumentPosition, String, DocumentFormat, String, InsertOptions) Inserts content from the file in the current document at the specified position.
InsertDocumentContent(DocumentPosition, String, DocumentFormat, String) Inserts content from the file in the current document at the specified position.
InsertDocumentContent(DocumentPosition, String, DocumentFormat) Inserts content from the file in the current document at the specified position.
InsertDocumentContent(DocumentPosition, String) Inserts content from the file in the current document at the specified position.
InsertHtmlText(DocumentPosition, String, InsertOptions) Inserts the specified HTML text into the specified position.
InsertHtmlText(DocumentPosition, String) Inserts the specified HTML text into the specified position.
InsertRtfText(DocumentPosition, String, InsertOptions) Inserts the specified formatted text into the specified position.
InsertRtfText(DocumentPosition, String) Inserts the specified formatted text into the specified position.
InsertSingleLineText(DocumentPosition, String) Inserts a single line of text (text without line breaks) at the specified position.
InsertText(DocumentPosition, String) Inserts the specified text at the specified position.
Replace(DocumentRange, String) Replaces the specified document range with the specified text string.
ReplaceAll(String, String, SearchOptions, DocumentRange) Finds all occurrences of the search string in the specified range, and replaces them with the replacement string.
ReplaceAll(String, String, SearchOptions) Finds all occurrences of the search string in the current document, and replaces them with the replacement string.
ReplaceAll(Regex, String, DocumentRange) Replaces all occurrences of a character pattern defined by a regular expression with a specified replacement string.
ReplaceAll(Regex, String) Replaces all occurrences of a character pattern defined by a regular expression with a specified replacement string.
SelectAll() Selects all the content in the document.
SetPageBackground(Boolean) Shows the background color of the page.
SetPageBackground(Color, Boolean) Sets the background color of the page and specifies whether it is shown.
SetPageBackground(Color) Set the background color of the page.
StartSearch(String, SearchOptions, SearchDirection, DocumentRange) Provides a search interface for a search in the specified range in the specified direction, using the specified options.
StartSearch(String, SearchOptions, SearchDirection) Provides a search interface for a search in the current document in the specified direction, using the specified options.
StartSearch(String) Provides a search interface with default parameters.
StartSearch(Regex, DocumentRange) Provides a search interface for a search in the specified range using a regular expression pattern.
StartSearch(Regex) Provides a search interface for a search in the document, using a regular expression pattern.
See Also