Skip to main content

SubDocument Members

In This Article
Exposes properties and methods representing essential document functionality.

#Properties

Name Description
Bookmarks Provides access to the collection of document bookmarks.
Comments
CustomMarks Provides access to a collection of custom marks.
Fields Provides access to the collection of fields in the current document.
Hyperlinks Provides access to a collection of hyperlinks in the document.
Images
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
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
AddParagraphsToList(DocumentRange, NumberingList, Int32) Obsolete. Apply the numbering list format specified by the NumberingList object to the paragraphs in the specified range.
AddParagraphToList(Paragraph, NumberingList, Int32) Obsolete. This API is obsolete now.
AddParagraphToList(Paragraph, Int32, Int32) Obsolete. This API is obsolete now.
AppendDocumentContent(DocumentRange) Appends content from the specified range to the end of the current document.
AppendDocumentContent(DocumentRange, InsertOptions) Appends content from the specified range to the end of the current document.
AppendDocumentContent(Stream, DocumentFormat) Appends content from the stream to the end of the current document.
AppendDocumentContent(Stream, DocumentFormat, String) Appends content from the stream to the end of the current document.
AppendDocumentContent(Stream, DocumentFormat, String, InsertOptions) Appends content from the stream to the end of the current document.
AppendDocumentContent(String, DocumentFormat) Appends content from the stream to the end of the current document.
AppendDocumentContent(String, DocumentFormat, String) Appends content from the file to the end of the current document.
AppendDocumentContent(String, DocumentFormat, String, InsertOptions) Appends content from the file to the end of the current document.
AppendHtmlText(String) Appends HTML formatted text to the end of the document.
AppendHtmlText(String, InsertOptions) Appends HTML formatted text to the end of the document.
AppendImage(DocumentImageSource) Obsolete. Appends a specified image to the end of the document.
AppendImage(Image) Obsolete. This API is obsolete now.
AppendParagraph() Obsolete. Appends an empty paragraph to the end of the document.
AppendRtfText(String) Appends formatted text to the end of the document.
AppendRtfText(String, InsertOptions) Appends formatted text to the end of the document.
AppendSingleLineText(String) Appends a single line of text to the end of the current document.
AppendText(String) Appends the specified text to the end of the document.
ApplySyntaxHighlight(List<SyntaxHighlightToken>) Performs a batch update of text formatting for document ranges corresponding to specified tokens.
BeginUpdate() Locks the SubDocument object by preventing visual updates until the EndUpdate method is called.
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.
CreateBookmark(DocumentPosition, Int32, String) Obsolete. Creates a bookmark with the specified name for the range that starts at the specified position and has a specified length. Then, adds it to the SubDocument.Bookmarks collection.
CreateBookmark(DocumentRange, String) Obsolete. Creates a bookmark for the specified range with the specified name and adds it to the SubDocument.Bookmarks collection.
CreateCustomMark(DocumentPosition, Object) Obsolete. Creates a custom mark at the specified position and associates specified data with it.
CreateHyperlink(DocumentPosition, Int32) Obsolete. Creates a hyperlink for the document range, starting at the specified position, and extending through a specified length.
CreateHyperlink(DocumentRange) Obsolete. Creates a hyperlink for the specified document range.
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 the specified range of text from the document.
DeleteCustomMark(CustomMark) Obsolete. Delete specified custom mark from the document's collection.
EndUpdate() Unlocks the SubDocument object after a call to the BeginUpdate method and 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 calling the SubDocument.BeginUpdateParagraphs method.
EndUpdateRangePermissions(RangePermissionCollection) Finalizes the update and applies the changes to range permissions.
FindAll(String, SearchOptions) Finds all text ranges that match the specified string in the current document.
FindAll(String, SearchOptions, DocumentRange) Finds all text ranges that match the specified string in the current document.
FindAll(Regex) Finds all occurrences of a character pattern specified by the regular expression.
FindAll(Regex, DocumentRange) Finds all occurrences of a character pattern specified by the regular expression.
GetCustomMarkByVisualInfo(CustomMarkVisualInfo) Obsolete. Provides access to a custom mark in the RichEditControl.CustomMarkDraw event handler.
GetHtmlText(DocumentRange, IUriProvider) Gets the text contained in the specified range in HTML format.
GetHtmlText(DocumentRange, IUriProvider, HtmlDocumentExporterOptions) Gets the text contained in the specified range in HTML format.
GetImages(DocumentRange) Obsolete. Gets all inline images in the specified document range.
GetMhtText(DocumentRange) Gets the content of the specified document range in MHT format.
GetMhtText(DocumentRange, MhtDocumentExporterOptions) Gets the content of the specified document range in MHT format.
GetOpenXmlBytes(DocumentRange) Gets the content of the specified document range in Office Open XML (Docx) format.
GetOpenXmlBytes(DocumentRange, OpenXmlDocumentExporterOptions) Gets the content of the specified document range in Office Open XML (Docx) format.
GetParagraph(DocumentPosition) Obsolete. Gets the paragraph encompassing the specified position.
GetParagraphs(DocumentRange) Obsolete. Provides access to paragraphs to which the specified range belongs.
GetRtfText(DocumentRange) Gets the formatted string of the text contained in the specified range.
GetRtfText(DocumentRange, RtfDocumentExporterOptions) Gets the formatted string of the text contained in the specified range.
GetShapes(DocumentRange) Obsolete. Get a collection of Shape objects contained in the specified document range.
GetSubDocumentType()
GetTableCell(DocumentPosition) Obsolete. Gets a table cell in which the specified position is located.
GetText(DocumentRange) Returns the plain text of the specified document range.
GetText(DocumentRange, TextFragmentOptions) Returns the plain text of the specified document range.
GetText(DocumentRange, PlainTextDocumentExporterOptions) Returns the plain text of the specified document range.
GetText(DocumentRange, PlainTextDocumentExporterOptions, TextFragmentOptions) Returns the plain text of the specified document range.
GetWordMLText(DocumentRange) Gets the text contained in the specified range in WordML format.
GetWordMLText(DocumentRange, WordMLDocumentExporterOptions) Gets the text contained in the specified range in WordML format.
InsertDocumentContent(DocumentPosition, DocumentRange) Inserts content from the specified range to the current document at the specified position.
InsertDocumentContent(DocumentPosition, DocumentRange, InsertOptions) Inserts content from the specified range to the current document at the specified position.
InsertDocumentContent(DocumentPosition, Stream, DocumentFormat) Inserts content from the stream to 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 postion, in the current document.
InsertDocumentContent(DocumentPosition, Stream, DocumentFormat, String) Insert content from the stream to the current document at the specified position.
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, String, DocumentFormat) Inserts content from the file to the current document at the specified position.
InsertDocumentContent(DocumentPosition, String, DocumentFormat, InsertOptions) Inserts content from the file to the current document at the specified position.
InsertDocumentContent(DocumentPosition, String, DocumentFormat, String) Inserts content from the file to the current document at the specified position.
InsertDocumentContent(DocumentPosition, String, DocumentFormat, String, InsertOptions) Inserts content from the file to the current document at the specified position.
InsertHtmlText(DocumentPosition, String) Inserts the specified HTML text into the specified position.
InsertHtmlText(DocumentPosition, String, InsertOptions) Inserts the specified HTML text into the specified position.
InsertImage(DocumentPosition, DocumentImageSource) Obsolete. Inserts an image into the specified position in the document.
InsertImage(DocumentPosition, Image) Obsolete. This API is obsolete now.
InsertParagraph(DocumentPosition) Obsolete. Inserts a new paragraph into the document's SubDocument.Paragraphs collection at a specified position.
InsertParagraph(DocumentPosition, InsertOptions) Obsolete. Inserts a new paragraph into the document at a specified position.
InsertPicture(DocumentPosition, DocumentImageSource) Obsolete. Inserts a picture as a floating object.
InsertPicture(DocumentPosition, Image) Obsolete. This API is obsolete now.
InsertRtfText(DocumentPosition, String) Inserts formatted text into the document at the specified position.
InsertRtfText(DocumentPosition, String, InsertOptions) 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.
InsertTable(DocumentPosition, Int32, Int32) Obsolete. Inserts a blank table with the specified number of rows and columns at the specified position.
InsertTable(DocumentPosition, Int32, Int32, AutoFitBehaviorType) Obsolete. Inserts a blank table with the specified number of rows and columns at the specified position.
InsertTable(DocumentPosition, Int32, Int32, AutoFitBehaviorType, Int32) Obsolete. Inserts a blank table with the specified number of rows and columns at the specified position.
InsertText(DocumentPosition, String) Inserts the specified text into the specified position.
InsertTextBox(DocumentPosition) Obsolete. Inserts a floating text box.
RemoveBookmark(Bookmark) Obsolete. Removes the specified bookmark from the bookmark collection of the document.
RemoveHyperlink(Hyperlink) Obsolete. Deletes a specified hyperlink.
RemoveNumberingFromParagraph(Paragraph) Obsolete. This API is obsolete now.
RemoveNumberingFromParagraphs(DocumentRange) Obsolete. Remove the numbering or bullet from all paragraphs intersecting the specified range.
Replace(DocumentRange, String) Replaces the specified document range with the specified text string.
ReplaceAll(String, String, SearchOptions) Replaces all occurrences of a character pattern defined by a regular expression with a specified replacement 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(Regex, String) Replaces all occurrences of a character pattern defined by a regular expression with a specified replacement string.
ReplaceAll(Regex, String, DocumentRange) 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.
SelectBookmark(Bookmark) Obsolete. Selects a range associated with the specified bookmark.
SetPageBackground(Boolean) Shows the background color of the page.
SetPageBackground(Color)
SetPageBackground(Color, Boolean)
StartSearch(String) Provides a search interface with default parameters.
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, SearchOptions, SearchDirection, DocumentRange) Provides a search interface for a search in the specified range in the specified direction, using the specified options.
StartSearch(Regex) Provides a search interface for a search in the document, using a regular expression pattern.
StartSearch(Regex, DocumentRange) Provides a search interface for a search in the specified range using a regular expression pattern.
See Also