Range Property

Applies To

Bookmark object, Cell object, Comment object, Endnote object, Footnote object, FormField object, Frame object, HeaderFooter object, Hyperlink object, Index object, InlineShape object, List object, Paragraph object, Revision object, Row object, Section object, Selection object, Subdocument object, Table object, TableOfAuthorities object, TableOfContents object, TableOfFigures object.

Description

Returns a Range object that represents the portion of a document that's contained in the specified object. Read-only.

For information about returning a range from a document or returning a shape range from a collection of shapes, see the Range method.

See Also

Range method, Text property.

Example

This example applies the Heading 1 style to the first paragraph in the active document.

ActiveDocument.Paragraphs(1).Range.Style = wdStyleHeading1
This example copies the first row in table one.

If ActiveDocument.Tables.Count >= 1 Then _
    ActiveDocument.Tables(1).Rows(1).Range.Copy
This example changes the text of the first comment in the document.

With ActiveDocument.Comments(1).Range
    .Delete
    .InsertBefore "new comment text"
End With
This example inserts text at the end of section one.

Set myRange = ActiveDocument.Sections(1).Range
With myRange
    .MoveEnd Unit:=wdCharacter, Count:=-1
    .Collapse Direction:=wdCollapseEnd
    .InsertParagraphAfter
    .InsertAfter "End of section"
End With