Range Property

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


expression Required. An expression that returns one of the objects in the Applies To list.


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


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 _

This example changes the text of the first comment in the document.

With ActiveDocument.Comments(1).Range
    .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
    .InsertAfter "End of section"
End With

Applies to | Bookmark Object | Break Object | Cell Object | Comment Object | Editor Object | Endnote Object | Footnote Object | FormField Object | Frame Object | HeaderFooter Object | HTMLDivision Object | Hyperlink Object | Index Object | InlineShape Object | Line Object | List Object | Paragraph Object | Rectangle Object | Revision Object | Row Object | Section Object | Selection Object | SmartTag Object | Subdocument Object | Table Object | TableOfAuthorities Object | TableOfContents Object | TableOfFigures Object | XMLNode Object

See Also | End Property | Range Property | SetRange Method | ShapeRange Collection Object | Start Property | Text Property | Working with Range Objects