Make your own free website on Tripod.com

.NET Plugins for MS Office 2007

Russian version
Version 2003


Supporting of plugins  for the Office System 2007 created with use of Microsoft .NET Framework.

ARCHITECTURE

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.

INSTALLATION:

Plugins in delivery

  1. Hello, Any Programs - in programs Word, Excel and Outlook shows message with name of host. For a conclusion of the message component Assistant is used.
  2. Hello, Outlook - in Explorer show name of application, in Inspector - Caption of window.
  3. Forward eMails - Forwarding message[s] without without adding proprietary information.

Written in C# и VB.NET.

Programming of plugins

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.

Localization

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.

  Main page

 % Load archive with the program: site-1 site2 site3