Visual Basic Concepts

What is Extensibility?

Extensibility is the capacity to extend or stretch the functionality of the development environment — to add something to it that didn't exist there before. Extensibility is not a new concept to development environments. Some language development packages give you the ability to add functionality to their user environments. However, the extent of control provided to you can be limited, or difficult to understand and implement.

Visual Basic provides you with a powerful, easy-to-understand modular system for customizing its environment through a programming interface known as the Extensibility object model. Its sole purpose is to allow you to "hook into" the workings of Visual Basic and create extensions known as add-ins.

The Visual Basic extensibility model consists of six related groups of individual code objects which control each major facet of the Visual Basic IDE. Each functional group enables you to create tools to customize the Visual Basic development environment and help you accomplish your programming tasks more quickly and easily. These groups are:

  • Form manipulation objects

  • User-interface manipulation objects

  • Event response objects

  • Add-in management objects

  • Project and component manipulation objects

  • Code manipulation objects

Each group consists of one or more collections and objects which together contribute to a particular purpose. For example, the primary function of the forms object group is to allow you to programmatically manipulate forms in your Visual Basic projects. One object in this group is the CommandBar object, which allows you to manipulate menus and toolbars. Another is the CodePane object, which allows you to display code contained in an object.

Other groups contain objects which allow you to manipulate and maintain the projects themselves, their source code, how they respond to events, and so forth.

What does all this mean to you? This means that you don't have to settle for the constraints of the programming environment or rely on third-party extensions that don't do exactly what you want them to do. You might, for example, create add-ins to:

  • Customize the Visual Basic user interface. For example, you can create an enhanced version of the Project Explorer window where you can customize views, add or delete folders, navigate and view project elements, and so on.

  • Control projects. You can design an add-in that loads a group of projects, one after another.

  • Programmatically edit code. You can use an add-in to automatically add comments to certain lines of code.

  • Control forms. You can create an add-in that closes all currently open forms, or one that adjusts all open forms to the same size.

These are just a few ideas. Add-ins give you the freedom to create custom programming solutions to save you time and help you become more productive. Just think of the possibilities!

*For more information* For information on different kinds of add-ins, see "What is an Add-In?" in this chapter.