.NET Plugins for MS Office 2007 |
Supporting of plugins for the Office System 2007 created with use of Microsoft .NET Framework.
Shared COM-Addin "Office2007.Plugins" is the dispatcher of .NET-plugins.
After start of a host program the dispatcher loads from assemblies in a folder bin\Plugins the classes being successors of base class DkmS.Office2007.PluginsFW.OfficePlugin.
Plugins are loaded only into the programs specified by attribute LoadIn. For start of plug-ins are used items of the dropping out menu that is accessible after pressing button Plugins which is added by the dispatcher to the basic tool panel of a host at loading.
Forward eMails - Forwarding message[s] without without adding proprietary information.
Written in C# и VB.NET.
The folder src\HelloWorld contains initial texts of plugins Hello, Any Programs and Hello, Outlook in C# (the project for Visual Studio 2005).
Describe a class derivative from classes OfficePlugin, wordPlugin, outlookPlugin, excelPlugin, realizing algorithms necessary for you.
Algorithms describe in method public override void DoAction (Public Overrides Sub DoAction for VB.NET).
Override method public override void InitializePlugin (object App, CommandBarControl Menu) for creating own command elements etc.
By means of attributes LoadIn describe names of hosts for a plug-in, attribute PlugName set an caption on the button to start your plug-in. (At inheritance from the specialized classes attribute LoadIn is not required)
For use of a subsystem of preservation of a configuration of plug-ins in the plug-in add the property having type, derivative of class DkmS.Office2007.PluginsFW.Config. At use of the specialized plug-ins it is in addition possible to define public override void methods RestoreConfig () and SaveConfig () which are called at loading and unloading of a plug-in accordingly.
At use as the prototype of a class wordPlugin there is an opportunity through attribute ShortKeyAttribute (string) to set a hot key for start of a plug-in (string has the syntax used in method SendKeys from Windows Scripting Host).
For plugin with prototype OutlookPlugin there is an opportunity to adding control to context menu by calling of method
AddToContextMenu(new OlObjectClass[] { OlObjectClass.olNote, OlObjectClass.olTask }); (Here the menu is modified for the notes and tasks).
At compilation connect (References...) assembly Office2007.Plugins.dll. Result of compilation place in a folder bin\plugins, reload plugins through item of the menu Plugins => Configure Plugins for...
Remark.
In the same folder place the assembly (library) used by yours plugin.
Framework Office2007.PluginsFW allows translation of the interface and plugins. The localization system are included in office2007.plugins.mui, example of localization of plugin - in Hello, Any Programs.mui. XML files are UTF-8 and can be edited in appropriate editor.