Range Object

Multiple objects
Range
Multiple objects

Represents a contiguous area in a document. Each Range object is defined by a starting and ending character position. Similar to the way bookmarks are used in a document, Range objects are used in Visual Basic procedures to identify specific portions of a document. However, unlike a bookmark, a Range object only exists while the procedure that defined it is running.

Note  Range objects are independent of the selection. That is, you can define and manipulate a range without changing the selection. You can also define multiple ranges in a document, while there can be only one selection per pane.

Using the Range Object

Use the Range method to return a Range object defined by the given starting and ending character positions. The following example returns a Range object that refers to the first 10 characters in the active document.

Set myRange = ActiveDocument.Range(Start:=0, End:=10)

Use the Range property to return a Range object defined by the beginning and end of another object. The Range property applies to many objects (for example, Paragraph, Bookmark, and Cell). The following example returns a Range object that refers to the first paragraph in the active document.

Set aRange = ActiveDocument.Paragraphs(1).Range

The following example returns a Range object that refers to the second through fourth paragraphs in the active document

Set aRange = ActiveDocument.Range( _
    Start:=ActiveDocument.Paragraphs(2).Range.Start, _
    End:=ActiveDocument.Paragraphs(4).Range.End)

For more information about working with Range objects, see Working with Range Objects .

Properties | Application Property | Bold Property | BoldBi Property | BookmarkID Property | Bookmarks Property | Borders Property | Case Property | Cells Property | Characters Property | CharacterWidth Property | Columns Property | CombineCharacters Property | Comments Property | Creator Property | DisableCharacterSpaceGrid Property | Document Property | Duplicate Property | Editors Property | EmphasisMark Property | End Property | EndnoteOptions Property | Endnotes Property | EnhMetaFileBits Property | Fields Property | Find Property | FitTextWidth Property | Font Property | FootnoteOptions Property | Footnotes Property | FormattedText Property | FormFields Property | Frames Property | GrammarChecked Property | GrammaticalErrors Property | HighlightColorIndex Property | HorizontalInVertical Property | HTMLDivisions Property | Hyperlinks Property | ID Property | Information Property | InlineShapes Property | IsEndOfRowMark Property | Italic Property | ItalicBi Property | Kana Property | LanguageDetected Property | LanguageID Property | LanguageIDFarEast Property | LanguageIDOther Property | ListFormat Property | ListParagraphs Property | NextStoryRange Property | NoProofing Property | Orientation Property | PageSetup Property | ParagraphFormat Property | Paragraphs Property | Parent Property | PreviousBookmarkID Property | ReadabilityStatistics Property | Revisions Property | Rows Property | Scripts Property | Sections Property | Sentences Property | Shading Property | ShapeRange Property | ShowAll Property | SmartTags Property | SpellingChecked Property | SpellingErrors Property | Start Property | StoryLength Property | StoryType Property | Style Property | Subdocuments Property | SynonymInfo Property | Tables Property | Text Property | TextRetrievalMode Property | TopLevelTables Property | TwoLinesInOne Property | Underline Property | Words Property | XML Property | XMLNodes Property | XMLParentNode Property

Methods | AutoFormat Method | Calculate Method | CheckGrammar Method | CheckSpelling Method | CheckSynonyms Method | Collapse Method | ComputeStatistics Method | ConvertHangulAndHanja Method | ConvertToTable Method | Copy Method | CopyAsPicture Method | Cut Method | Delete Method | DetectLanguage Method | EndOf Method | Expand Method | GetSpellingSuggestions Method | Getting Help on Macintosh Keywords | Getting Help on Macintosh Keywords | GoTo Method | GoToEditableRange Method | GoToNext Method | GoToPrevious Method | InRange Method | InsertAfter Method | InsertAutoText Method | InsertBefore Method | InsertBreak Method | InsertCaption Method | InsertCrossReference Method | InsertDatabase Method | InsertDateTime Method | InsertFile Method | InsertParagraph Method | InsertParagraphAfter Method | InsertParagraphBefore Method | InsertSymbol Method | InsertXML Method | InStory Method | IsEqual Method | LookupNameProperties Method | ModifyEnclosure Method | Move Method | MoveEnd Method | MoveEndUntil Method | MoveEndWhile Method | MoveStart Method | MoveStartUntil Method | MoveStartWhile Method | MoveUntil Method | MoveWhile Method | Next Method | NextSubdocument Method | Paste Method | PasteAndFormat Method | PasteAppendTable Method | PasteAsNestedTable Method | PasteExcelTable Method | PasteSpecial Method | PhoneticGuide Method | Previous Method | PreviousSubdocument Method | Relocate Method | Select Method | SetRange Method | Sort Method | SortAscending Method | SortDescending Method | StartOf Method | TCSCConverter Method | WholeStory Method

Parent Objects | Bookmark Object | Break Object | Cell Object | Characters Collection | Comment Object | Document Object | Editor Object | Endnote Object | Endnotes Collection | Envelope Object | Field Object | Footnote Object | Footnotes Collection | FormField Object | Frame Object | HeaderFooter Object | HTMLDivision Object | Hyperlink Object | Index Object | InlineShape Object | Line Object | List Object | MailMergeField Object | Paragraph Object | Range Object | Rectangle Object | Revision Object | Row Object | Section Object | Selection Object | Sentences Collection | Shape Object | ShapeRange Object | SmartTag Object | Subdocument Object | Table Object | TableOfAuthorities Collection | TableOfContents Collection | TableOfFigures Collection | TextFrame Object | Words Collection | XMLNode Object

Child Objects | Bookmarks Object | Borders Object | Cells Object | Characters Object | Columns Object | Comments Object | Document Object | Editors Object | EndnoteOptions Object | Endnotes Object | Fields Object | Find Object | Font Object | FootnoteOptions Object | Footnotes Object | FormFields Object | Frames Object | HTMLDivisions Object | Hyperlinks Object | InlineShapes Object | ListFormat Object | ListParagraphs Object | PageSetup Object | ParagraphFormat Object | Paragraphs Object | ProofreadingErrors Object | Range Object | ReadabilityStatistics Object | Revisions Object | Rows Object | Sections Object | Sentences Object | Shading Object | ShapeRange Object | SmartTags Object | Subdocuments Object | SynonymInfo Object | Tables Object | TextRetrievalMode Object | Words Object | XMLNode Object | XMLNodes Object

See Also | Assigning Ranges | Modifying a Portion of a Document | Selection Object | TextRetrievalMode Object | Working with Range Objects