programmers like me create add-ins primarily because we feel short of features when working with microsoft tools.i it seems at times that microsoft hasn't yet developed the tool we need. in fact, microsoft has done a wonderful job of adding new features to each release of its development tools. obviously, microsoft can't design features to fulfill the needs of each and every programmer so it made visual basic (vb) an extensible product, thereby providing the way for vb developers to create their own features.
eom stands for extensibility object model. you might ask what is extensibility? extensibility is the capability to extend or stretch the functionality of different development tools, specifically the microsoft integrated development environment (ide). ide provides a programming interface known as the extensibility object model, a set of powerful interfaces for customizing the environment. it allows you to hook into the ide to create extensions known as add-ins. a good system is the one that can be extended without jeopardizing the primary functionality of the system.
to implement extensibility features, vb offers the powerful eom. through eom, many core objects in vb itself are available to you at no extra charge. eom is not that easy to learn, and this article will provide you only the basics of add-in creation. you will have to delve into this vast field yourself to explore the wonders you can do using the eom.
eom consists of six loosely coupled packages of objects with methods that implement key services of the vb development model. these are:
core objects
form manipulation
event response
add-in management
project and component manipulation
code manipulation
core objects
this package is the main package used in the creation of add-ins. it has the following objects:
the root object
the idtextensibility interface object
the visual basic instance variable
the root object
vbe is the root object in visual basic. the vbe object is the base object for every extensibility object and collection in visual basic. each object and collection owns a reference to the vbe property. the collections owned by the vbe object include the following:
vbprojects
windows
codepanes
commandbars
the vbprojects collection
this collection enables you to access a set of vb properties. this feature can be helpful if your development environment has an established process for developing software. some of the key properties and methods of this collection are:
filename: returns the full pathname of the group project file.
startproject: returns or sets the project that will start when users choose the start menu from the run menu, click the run button, or press the f5 key.
addfromfile: this is a method that enables the users to add or open a project or group object. its only required argument is the string representing the path of the file you want to add.
addfromtemplate: this method enables you to add project templates into the vbprojects collection. its only required argument is the string representing the path of the file you want to use as a template.
the windows collection
with the windows collection, you can access windows, such as the project and properties windows. this collection enables you to access a group of all currently open code windows and designer windows.
the idtextensibility interface object
the idtextensibility interface object exposes the public methods and properties of the extensibility model. by exposes, i mean that because you don't directly use the services, methods, and properties of the underlying extensibility model, you need to invoke the methods of the model's agent. you can think of interfaces as public agents for the private implementation of an extensibility model object you instantiate.
the visual basic instance variable
this is also known as the dynamic identification variable. it identifies a particular instance of your vb session. this instance identifier enables you to have separately identifiable running instances of vb in memory.
the instance variable is of the type vbide.vbe. to use this variable, declare it in a class module or general module.
please refer to the microsoft web site (see http://www.microsoft.com) for complete details of these packages. please understand that i cannot explain each and every detail of these packages in this short article.