basic question on Range object syntax

J

Jonathan West

Klaus Linke said:
This may be splitting hairs, but I tend to agree with Larry.

As the help file says, the Document object has a PageSetup property that
*returns* (rather than *is*) a PageSetup object.

For me, you can make an object do tricks (methods) and can make it return
internal info (properties).
The trick may be to return a Range object, in which case the method will be
called Range method.
The info returned can be a Range object, in which case the property will be
called Range property.

As far as I can see, there is little if any practical difference between a
read-only property that returns either is simple value or an object, and a
method that returns the same simple value or object.

There is also little practical difference between a read-write property and
a matched pair of methods which read and set the value of some internal
object or variable.

The only difference between a property and a method/method pair is the
syntax in the language used to express it. Within the Word object model,
there is a convention that properties return information of some aspect of
the object, while methods return values or objects that are related in some
way to the object, or which return information about the operation performed
on the object by the method. But it is important to realise that this is
simply a convention - that in VBA at least it appears that properties and
methods are largely interchangeable.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top