Document.Range Method
Word Developer Reference |
Returns a Range object by using the specified starting and ending character positions.
Syntax
expression.Range(Start, End)
expression Required. A variable that represents a Document object.
Parameters
Name | Required/Optional | Data Type | Description |
---|---|---|---|
Start | Optional | Variant | The starting character position. |
End | Optional | Variant | The ending character position. |
Return Value
Range
Example
This example applies bold formatting to the first 10 characters in the active document.
Visual Basic for Applications |
---|
|
This example creates a range that starts at the beginning of the active document and ends at the cursor position, and then it changes all characters within that range to uppercase.
Visual Basic for Applications |
---|
|
This example creates and sets the variable myRange to paragraphs three through six in the active document, and then it right-aligns the paragraphs in the range.
Visual Basic for Applications |
---|
|
See Also