.NET project architecture of Office addin /
plugin in Visual Studio: C#, VB.NET, C++
Add-in Express™
Architecture of Add-in Express projectsEach Add-in Express solution is an ActiveX library (DLL, an in-process COM server) that contains one or several Automation objects which implement the interfaces required by the supported technology, e.g. IDTExtensibility2, IRibbonExtensibility, IRtdServer or ISmartTagRecognizer. By default, every project based on Add-in Express includes two projects: the add-in project itself and its setup project that can be used to deploy your addin. Component-centric programming modelAdd-in Express adds a special module to your project - the add-in module - which is the heart of the Add-in Express framework and your Office addin project. It implements all necessary COM interfaces and contains a lot of application-specific code that takes care of all features and pitfalls of the target application(s). The add-in module is also a container for all components such as toolbars, menus, ribbon tabs, event helpers as well as for any other components (for example, your DB-aware components). So, the AddinModule is a central module for your projects where you place Office-specific and any other components, write your applied code and build the main logic of your MS Office addin. Sure, this main module is a component itself and has a visual designer; its properties and events are available in the Properties window. Remember, whenever you need to do some task, you add a special component to the add-in module and create a new event handler. So, all your work is centered around this main module, around components added to the add-in module and their events. For example, the addin module publishes several addin- and application-specific events such as AddinStartupComplete, NewMail, NewInspector, RibbonBeforeCreate, etc. Thus, to add your code on the add-on start-up, you create an event handler of the appropriate event of your add-in module. More about Add-in Express components: Menu, command bar, ribbon components and Office Ribbon and Toolbar designers. Code example of the add-in moduleBelow you can find an example of the initial source code generated by Add-in Express (some automatically generated regions are collapsed), which will be the base code of your Office plugin:
Your Office solutions are secure, isolated, deployable and updatableIn accordance with a strict Office security policy, Add-in Express isolates each of your extensions into a separate application domain and allows you to unload your managed extensions on the fly not affecting any other add-ins installed on the end-user's machine. To isolate your Office extensions, you use the Add-in Express Loader delivered with Add-in Express, which can be signed by your own digital certificate. Deploy your Office solutions effortlesslyAll setup projects generated by Add-in Express support the rigorous Windows 7, Windows 8 and Office security models, contain all necessary prerequisites and are completely compatible with the ClickOnce technology. |
See Also
|