Working with the Range Object

If you've used VBA with Excel, you probably know that Excel has no separate object to represent a cell. Instead, a cell is considered to be just an instance of the generic Range class.

Along similar lines, Word has no separate objects for its most fundamental text units: the character and the word. Like Excel, Word considers these items to be instances of a generic class, which is also called the Range object. A Range object is defined as a continuous section of text in a document: a few characters in a row, a few words in a row, and few paragraphs in a row, or whatever. A range can be anything from a single character to an entire document, as long as the text within the range is continuous.

There are two basic methods for returning a Range object: the Document object's Range method and the Range property.

0 0

Post a comment