Selection Methods (Word)
Contribute to this content Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation. |
Methods
Name |
Description |
---|---|
Adds the bold character format to or removes it from the current run. |
|
Calculates a mathematical expression within a selection. Returns the result as a Single. |
|
Removes all character formatting (formatting applied either through character styles or manually applied formatting) from the selected text. |
|
Removes character formatting (formatting that has been applied manually using the buttons on the ribbon or through the dialog boxes) from the selected text. |
|
Removes character formatting that has been applied through character styles from the selected text. |
|
Removes text and paragraph formatting from a selection. |
|
Removes all paragraph formatting (formatting applied either through paragraph styles or manually applied formatting) from the selected text. |
|
Removes paragraph formatting that has been applied manually (using the buttons on the ribbon or through the dialog boxes) from the selected text. |
|
Removes paragraph formatting that has been applied through paragraph styles from the selected text. |
|
Collapses a selection to the starting or ending position. After a selection is collapsed, the starting and ending points are equal. |
|
Converts text within a range to a table. Returns the table as a Table object. |
|
Copies the specified selection to the Clipboard. |
|
The CopyAsPicture method works the same way as the Copy method. |
|
Copies the character formatting of the first character in the selected text. |
|
Adds a new AutoTextEntry object to the AutoTextEntries collection, based on the current selection. |
|
Adds a default-size text box around the selection. |
|
Removes the specified object from the document and moves it to the Clipboard. |
|
Deletes the specified number of characters or words. |
|
Analyzes the specified text to determine the language that it is written in. |
|
Moves or extends the selection to the end of the specified unit. |
|
Moves or extends the ending character position of a range or selection to the end of the nearest specified text unit. |
|
Cancels a mode such as extend or column select (equivalent to pressing the ESC key). |
|
Expands the specified range or selection. Returns the number of characters added to the range or selection. Long. |
|
Saves the current selection as PDF or XPS format. . |
|
Turns on extend mode, or if extend mode is already on, extends the selection to the next larger unit of text. |
|
Moves the insertion point to the character position immediately preceding the specified item, and returns a Range object (except for the wdGoToGrammaticalError, wdGoToProofreadingError, or wdGoToSpellingError constant). |
|
Returns a Range object that represents an area of a document that can be modified by the specified user or group of users. |
|
Returns a Range object that refers to the start position of the next item or location specified by the What argument. If you apply this method to the Selection object, the method moves the selection to the specified item (except for the wdGoToGrammaticalError, wdGoToProofreadingError, and wdGoToSpellingError constants). |
|
Returns a Range object that refers to the start position of the previous item or location specified by the What argument. If applied to a Selection object, GoToPrevious moves the selection to the specified item. Range object. |
|
Moves or extends the selection to the beginning of the specified unit. This method returns an integer that indicates the number of characters the selection was actually moved, or it returns 0 (zero) if the move was unsuccessful.This method corresponds to functionality of the HOME key. |
|
True if the selection to which the method is applied is contained within the range specified by the Range argument. |
|
Inserts the specified text at the end of a range or selection. |
|
Inserts the specified text before the specified selection. . |
|
Inserts a page, column, or section break. |
|
Inserts a caption immediately preceding or following the specified selection. |
|
Adds cells to an existing table. |
|
Inserts columns to the left of the column that contains the selection. |
|
Inserts columns to the right of the current selection. |
|
Inserts a cross-reference to a heading, bookmark, footnote, or endnote, or to an item for which a caption label is defined (for example, an equation, figure, or table). |
|
Inserts the current date or time, or both, either as text or as a TIME field. |
|
Inserts all or part of the specified file. |
|
Inserts an = (Formula) field that contains a formula at the selection. |
|
Inserts a new page at the position of the Insertion Point. |
|
Replaces the specified selection with a new paragraph. |
|
Inserts a paragraph mark after a selection. |
|
Inserts a new paragraph before the specified selection or range. |
|
Inserts the specified number of new rows above the row that contains the selection. If the selection isn't in a table, an error occurs. |
|
Inserts rows above the current selection. |
|
Inserts rows below the current selection. |
|
Inserts a special hidden paragraph mark that allows Microsoft Word to join paragraphs formatted using different paragraph styles, so lead-in headings can be inserted into a table of contents. |
|
Inserts a symbol in place of the specified selection. |
|
Inserts the specified XML into the document at the cursor, replacing any selected text. |
|
True if the selection to which this method is applied is in the same story as the range specified by the Range argument. |
|
True if the selection to which this method is applied is equal to the range specified by the Range argument. |
|
Adds the italic character format to or removes it from the current run. |
|
Sets the reading order and alignment of the specified paragraphs to left-to-right. |
|
Sets the reading order and alignment of the specified run to left-to-right. |
|
Collapses the specified selection to its start or end position and then moves the collapsed object by the specified number of units. This method returns a Long value that represents the number of units by which the selection was moved, or it returns 0 (zero) if the move was unsuccessful. |
|
Moves the selection down and returns the number of units it has been moved. |
|
Moves the ending character position of a range or selection. |
|
Moves the end position of the specified selection until any of the specified characters are found in the document. |
|
Moves the ending character position of a selection while any of the specified characters are found in the document. |
|
Moves the selection to the left and returns the number of units it has been moved. |
|
Moves the selection to the right and returns the number of units it has been moved. |
|
Moves the start position of the specified selection. |
|
Moves the start position of the specified selection until one of the specified characters is found in the document. If the movement is backward through the document, the selection is expanded. |
|
Moves the start position of the specified selection while any of the specified characters are found in the document. |
|
Moves the specified selection until one of the specified characters is found in the document. |
|
Moves the selection up and returns the number of units that it has been moved. |
|
Moves the specified selection while any of the specified characters are found in the document. |
|
Returns a Range object that represents the next unit relative to the specified selection. |
|
Selects the next field. |
|
Locates and returns the next tracked change as a Revision object. |
|
Moves the selection to the next subdocument. |
|
Inserts the contents of the Clipboard at the specified selection. |
|
Pastes the selected table cells and formats them as specified. |
|
Merges pasted cells into an existing table by inserting the pasted rows between the selected rows. No cells are overwritten. |
|
Pastes a cell or group of cells as a nested table into the selection. |
|
Pastes and formats a Microsoft Excel table. |
|
Applies formatting copied with the CopyFormat method to the selection. |
|
Inserts the contents of the Clipboard. |
|
Moves the selected text by the specified number of units, and returns a Range object relative to the collapsed selection. |
|
Selects and returns the previous field. |
|
Locates and returns the previous tracked change as a Revision object. |
|
Moves the selection to the previous subdocument. |
|
Increases the size of the displayed text one point size when the document is displayed in Reading mode. |
|
Decreases the size of the displayed text one point size when the document is displayed in Reading mode. |
|
Sets the reading order and alignment of the specified paragraphs to right-to-left. |
|
Sets the reading order and alignment of the specified run to right-to-left. |
|
Selects the specified text. |
|
Selects the entire cell containing the current selection. |
|
Selects the column that contains the insertion point, or selects all columns that contain the selection. |
|
Extends the selection forward until text with a different paragraph alignment is encountered. |
|
Extends the selection forward until text with a different color is encountered. |
|
Extends the selection forward until text in a different font or font size is encountered. |
|
Extends the selection forward until text with different left or right paragraph indents is encountered. |
|
Extends the selection forward until a paragraph with different line spacing is encountered. |
|
Extends the selection forward until a paragraph with different tab stops is encountered. |
|
Selects the row that contains the insertion point, or selects all rows that contain the selection. |
|
Sets the starting and ending character positions for the selection. |
|
Shrinks the selection to the next smaller unit of text. |
|
Cancels the selection of all but the most recently selected text when a selection contains multiple, unconnected selections. |
|
Sorts the paragraphs in the specified selection. |
|
Sorts paragraphs or table rows in ascending alphanumeric order. |
|
Sorts the headings in the specified selection. |
|
Sorts paragraphs or table rows within the selection in descending alphanumeric order. |
|
Inserts an empty paragraph above the first row in the selection. . |
|
Moves or extends the start position of the specified range or selection to the beginning of the nearest specified text unit. This method returns a Long that indicates the number of characters by which the range or selection was moved or extended. The method returns a negative number if the movement is backward through the document. |
|
Switches a selection between a Unicode character and its corresponding hexadecimal value. |
|
Deletes the character preceding a collapsed selection (an insertion point). |
|
Inserts a new, blank paragraph. |
|
Inserts the specified text. |
|
Expands a selection to include the entire story. |