If you read other books and technical articles about OOP, some of them will claim that Microsoft Visual Basic 6 (the VB version that is used in Word VBA) isn't even object oriented in the first place.(Note: You don't have to know any of this to write VBA programs. If you just want to skip the rest of this section and move ahead to the next lesson, go right ahead!)
"Scoff, scoff, chortle, chortle!" They say, "VB 6 is just a toy language pretending to be object oriented! It doesn't even implement inheritance. Chortle, chortle, scoff, scoff!" To this claim, I have several levels of response:
Sez you!!
There is no international standard that defines what is, and what is not, 'object oriented'. Microsoft created Visual Basic to give programmers the greatest 'bang' for their programming 'buck'. I say they did a pretty good job with OOP in VB 6 and the fact that it became the most widely used programming language says it all. The people who make this claim usually do it so they can hold up their favorite programming language as the ideal OOP language. Well ... VB is my favorite programming language and I say it hits that sweet spot of what is as OOP as possible without being so complex that you can't get anything done!
If you want a more complete and more complex type of OOP, try VB.NET! This version of VB implements OOP 'to the nines'! including a rich inheritance model.
With that said, let's look at what they're talking about.
Traditionally, an OOP programming technology incorporates three features:
- polymorphism
- encapsulation
- inheritance
Polymorphism means that objects will do different things when they're used differently. "Poly" meaning "many" and "morph" meaning "form or shape". So, for example, if you have a "printer" object, it will do something entirely different for a desktop ink jet printer versus a high-speed printing press. Visual Basic 6 implements polymorphism quite well.
Encapsulation means that an object can be treated as a "black-box". We can use it without knowing how it works. This is sometimes called "data-hiding". The details that make an object work are "hidden". If you have a "printer" object, you don't need to know how it sends stuff to be printed. You only know how to send stuff to be printed to it. Visual Basic 6 also implements encapsulation.
Inheritance lets you write a program that creates a new object by basing it on an existing one. If you have a "basicPrinter" object, you can create an ink jet printer object by inheriting all the methods and properties of "basicPrinter" and then just building on them. Visual Basic 6 doesn't allow you to do this, but VB.NET does! One example of the complexities of inheritance is that different "fully OOP" languages have some very significant differences in the way they implement it. C++, for example, implements what is called "multiple inheritance" and Java does not.
Enough Theory! It's about time to get back to what we're really here for: writing programs! In the next lesson, we write a program that could actually be quite useful to you! To check it out, click here.

