Eugene Starostin

Add new items to your add-in project

The structure of COM add-in solutions based on Add-in Express is truly :-) described in the Add-in Express Developer’s Guide. Every time Add-in Express includes three projects in these solutions: the add-in project itself, the shim project in C++ and the setup project.

Since COM add-ins are issues of the COM technology, all the three parts of an add-in solution (add-in project, shim project and setup project) are connected with each other via GUIDs or ProgIDs. In fact, GUID in add-in solutions is a common thing. However, please note that all these GUIDs are generated automatically when a solution is being created and their dependencies are set only once. That is why I advise you not to change them either in the source code, or in resources, or in the Properties Window. I also advise you not to create new projects by means of copying and renaming the existing ones. To rename files is not enough. It is also necessary to change all GUIDs keeping all dependencies between them. Once I was silly enough to do this way. It seems I would have needed a pile of paper if I had printed out all my correspondence with our support service. :-)

Well, I have already told you about shims in my previous post, now I will describe the add-in project as part of the add-in solution.

The add-in project

The main module that centralizes the development of the add-in is called the add-in module. It is here that you tell your add-in what its host application is :-) It is here that you concentrate the main event handlers of the add-in host applications, such as OnNewExplorer or OnNewMail in Outlook, BeforeDocumentSave in Word, etc. It is here that you create your own command bars and event handlers of their controls. Command bars and buttons are described in our documentation. Host application events are regularly discussed on our forums. Here I will tell you what else can be included in the add-in project. All this is concentrated in the Add New Item window that comes up when you right-click the add-in project.

COM Add-in Module. Yes, it is one more add-in module. By adding one more add-in module to the add-in project you will be able to implement another add-in in the same assembly. Do you need it? I’m not sure. But every time you start a new project remember about this possibility. Probably it makes sense to combine some of your add-ins in one solution and one assembly in case they have a lot of common code.

COM Add-in Additional Module a strange name, isn’t it? :-) The guys from the ADX Team seem to be trying to confuse even themselves. But it is really an additional add-in module. It will supplement your main module in case it has grown up too big in size. For example, in add-ins for several host applications I always use separate add-in modules for each host. It allows me to control the code more accurately and avoid a horrible mess of code for Outlook, Word, Excel, PowerPoint… Well, you remember how many host applications Add-in Express supports, don’t you? :-)

COM Excel Add-in Module this module implements the functionality of the Excel Automation Add-in. You may need it only if you want to add new functions that can be used in Excel formulas.

ADX Excel Worksheet Module this module allows you to handle events of any controls, i.e. ActiveX-es, placed in a specified Excel worksheet. With this module you can build a complete Excel solution and get rid of VBA. Sure, only in case you are tired of VBA :-)

ADX Word Document Module is the same as the previous module. Use it for creating Word-based applications. BTW, I don’t understand Microsoft attitude to VBA. Is VBA dead? All in all, these modules (ADX Excel Worksheet Module and ADX Word Document Module) implement what can be got with VSTO. Indeed, in my opinion, VSOT is more convenient for developing Word documents and Excel worksheets. Hmm… We should bring together our Add-in Express and VSTO! :-)

ADX Outlook Property Page is a form used for creating new tabs in the main Options window and Folder Properties for Outlook. The best use of these tabs is settings of your add-ins or setting for some folders.

Classes in the build that I have (2.3.1753) I found out ADX Outlook Items Events, ADX Outlook Item Events, ADX Outlook Folders Events, ADX Excel Worksheet Events. Each of them adds to the add-in a class-helper that makes the handling of corresponding events more comfortable. I will write about these helpers some day. I suppose they are already used by some of our customers, but they hardly read my Blog. I also suspect that the number of these classes will be increasing from build to build as well as the number of our customer is increasing. Probably we will get tired of it (but not of the increasing number of our customers! :-) and make up a class that will handle any events of any instances. And then I will retire. :-)

Post a comment

Have any questions? Ask us right now!