Objects and References

When an Office object is created, it exists in your computer's memory. Fortunately, you do not have to deal with the details of memory addresses and the like, but rather you manipulate objects by means of references. A reference is nothing more than a variable that has been initialized to “point” at the object in memory. While it is possible to have more than one reference to a single object, it is important to remember that only a single copy of that object exists. (Although there may of course be multiple copies, or instances, of the same type of object.)

There are two parts to using object references. You must create a variable to hold the reference, then you must create an instance of the object, obtain the reference ...

Get Office® XP Development with VBA now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.