Scenarios for Using AddIns


Addins provide a mechanism to extend the core functionality of an application so that the new functionality will be available throughout the application. The key to writing effective add-ins in Office is to develop them so that they look and feel like natural extensions to the Office application. A few examples of what add-ins can do in Office include the following:

  • Extending existing functionality If your users need to print to a color printer but often find it difficult to find the color printer nearest to them, you could write an add-in to mitigate this issue. The add-in could add a Print to Color Printer command to their File menu and a Print to Color Printer button to their standard toolbar. When the user clicks the button or selects the menu item, your add-in can handle that event and print to the nearest color printer.

  • Integrating with data An add-in could be written that loads into Word and Excel that pulls data from a Web service and pastes it into the Office application. The add-in could add a Paste Sales Information menu item, for example. When the user selects the command from within Word, it would paste a table with the data from the Web service at the position where your cursor is in Word. In Excel, it would paste into the selected cells.

Functionality that needs to be available for only one particular document or template type is better written using the codebehindadocument pattern. If sales information needs to be retrieved only when working with a Quarterly Report.doc file, for example, it is better to put your code that retrieves the sales information into code behind the template or document for the quarterly report. This is an example of choosing the right context for your code. There is no reason to clutter the application context with commands that are used for only a particular document or template.




Visual Studio Tools for Office(c) Using Visual Basic 2005 with Excel, Word, Outlook, and InfoPath
Visual Studio Tools for Office: Using Visual Basic 2005 with Excel, Word, Outlook, and InfoPath
ISBN: 0321411757
EAN: 2147483647
Year: N/A
Pages: 221

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net