Ho to develop Outlook add-in in C#. Excel, PowerPoint, FrontPage plug-in examples

Visual C# .NET HOWTOs

  1. How to develop your first COM add-in for Microsoft Office in C#
  2. How to program your first C# Outlook add-in
  3. How to develop an Excel RTD server in C#
  4. How to build an Excel Automation add-in
  5. How to write smart tags in C#
  6. How to place a .NET control onto a custom Outlook toolbar
  7. How to put a .NET control onto a custom Excel toolbar in C#
  8. How to move a custom C# .NET form embedded into Outlook Explorer or Inspector from one form region to another
  9. How to cache forms embedded into Outlook Explorer windows
  10. How to re-size a form embedded into Outlook Explorer or Inspector window
  11. How to identify the form in an Outlook Advanced Form region in C#
  12. How to set the visibility of the form in an Outlook Advanced Form Region
  13. How to use events of Reading Pane, Navigation Pane, and To-Do bar
  14. How to use several forms in one Advanced Form Region
  15. How to switch between the standard Outlook explorer view and your custom C# form
  16. How to handle the ItemSend event of MS Outlook in C#
  17. How to scan Outlook folders
  18. How to handle Outlook's SelectionChange event
  19. How to access MAPIFolder from the code of the Outlook property page
  20. How to create and delete hidden Outlook items via Extended MAPI
  21. How to handle the ExplorerClose event (Outlook) in C#
  22. How to add custom menu items to the popup menu in Outlook Explorer
  23. How to create a command bar and command bar controls at run time (for Outlook)
  24. How to handle the WorkbookBeforeSave event of MS Excel
  25. How to handle the MouseClick event on presentation's objects (PowerPoint) in C#
  26. How to use dbs as a data source for RTD Servers in C#
  27. How to make an Excel task pane visible / invisible programmatically
  28. How to interact with several Advanced Excel Task Panes in one layout position
  29. How to develop a context-dependent Excel task pane
  30. How to re-size an Excel task pane programmatically
  31. How to handle the FrontPage OnWindowActivate event
  32. How to handle the TaskChange event of MS Project in C#
  33. How to change the CommandBarComboBox (TadxCommandBarComboBox) properties at run time
  34. How to disable Outlook security in a COM add-in?
  35. How to disable Outlook security in a standalone application?
  36. How to disable security warnings which show up when I use the Outlook object model, CDO, or Simple MAPI?
  37. How to create a custom toolbar in Excel?
  38. How to show a toolbar for Outlook mail items only?
  39. How to add a context menu item to the context menu of Outlook explorer?
  40. How to add a property page to the Tools | Option menu in Outlook?
  41. How to process Open, Read, Reply, ReplyAll, Send, etc events for a mail, task, appointment, etc in Outlook?
  42. How to determine if an item was added to, changed in, or removed from a given Outlook folder(s)?
  43. How to determine if an Outlook folder was created, moved, deleted?
  44. How to create a simple RTD server?
  45. How to create a simple Smart Tag?
  46. How to implement a custom recognizer for a Smart Tag?
  47. How to create a simple Excel Automation add-in in C#?
  48. How to process Change, SelectionChange, and other events of the Excel Worksheet class?
  49. How to create an Excel document level add-in in C# ?
  50. How to create a Word document level add-in?
  51. How to add a custom .NET control onto an Office toolbar?

1.  How to develop your first COM add-in for Microsoft Office in C#

This Visual C# sample add-in demonstrates how you can use Add-in Express 2008 for .NET to create a COM add-in supporting all versions of several Office applications (e. g Excel and Word), build toolbars and toolbar bar controls, add custom Office 2007 Ribbon tabs, make Office 2007 task panes and more.

    If you have Add-in Express installed, you can find this C# example in the Samples folder of the Add-in Express installation folder (C:\Program Files\Add-in Express\Add-in Express 2007 for .NET %Edition%\Docs\Samples\). Also, please see a similar sample of building an Office add-in in the online Add-in Express Developer's Guide.

    Available downloads:
    Sample add-in project for VS 2005   Sample add-in project for VSTO 2005 SE (Excel 2003)

     


    2.  How to program your first C# Outlook add-in

    This Outlook add-in gives an example of how to write a COM add-in that works across all Outlook versions from Outlook 2000 to Outlook 2007, how to develop Outlook-specific command bars and command bar controls, create Outlook 2007 Ribbon controls in Ribbon tabs and Outlook menu, make and controll Outlook 2007 forms, add custom property pages to the Tools | Options and Folder Properties dialogs and more.

    You can find this C# Outlook addin in the Samples folder of the Add-in Express installation folder(C:\Program Files\Add-in Express\Add-in Express 2007 for .NET %Edition%\Docs\Samples\). Also, please see the complete list of Add-in Express features for Outlook 2000 - 2007 and Add-in Express flash videos on how to write Outlook 2007 plug-in.

    Available downloads:
    Sample add-in project for VS 2005   Sample add-in project for VSTO 2005 SE (Outlook 2003)

     


    3.  How to develop an Excel RTD server in C#

    This RTD server sample project is described in in the online Developer's Guide - see Excel Real-Time Data server sample in VB.NET. Also see the Add-in Express flash video about Programming RTD servers .

    Download ZIP file

     


    4.  How to build an Excel Automation add-in

    This Visual C# Excel Automation Add-in sample project is described in Automation add-in sample in VB.NET in the online Developer's Guide.

    Download ZIP file

     


    5.  How to write smart tags in C#

    This download accompanies the sample smart tag in VB.NET in the online Developer's Guide.

    Download ZIP file

     


    6.  How to place a .NET control onto a custom Outlook toolbar

    This sample add-in (C# for Visual Studio 2005) intercepts the SelectionChange event of Outlook Explorer and displays selected properties of the currently selected MailItem in a UserControl that is added to a new toolbar. Find more about how to customize Outlook toolbar with any .NET controls. See also a video about customizing Outlook 2003 toolbar.

    Download ZIP file

     


    7.  How to put a .NET control onto a custom Excel toolbar in C#

    This Excel addin is an example of how to process a number of Excel events: WorkbookActivate, SheetChange, NewWrokbook, etc. In the user-interface, the add-in shows the current state of AutoFilter and allows changing them via the Dialog class of the Excel object model. The sample is written in C# for Visual Studio 2005. See also Add-in Express video about how to add custom .NET controls to Excel toolbar.

    Download ZIP file

     


    8.  How to move a custom C# .NET form embedded into Outlook Explorer or Inspector from one form region to another

    When embedding a custom form into an Outlook window, you may want to change the form's layout at run-time. This sample add-in demonstrates how you accomplish this task in C#. The user-interface of the add-in shows a command bar or a Ribbon tab (Office 2007 only) and allows choosing the layout from a combo box. Both source code and the setup project are included. Please note, you may need to change the references for the project to compile.

    Available downloads:
    Sample add-in project for VS 2005   Sample add-in project for VSTO 2005   Sample add-in project for VSTO 2005 SE

     


    9.  How to cache forms embedded into Outlook Explorer windows

    For forms embedded into Outlook Explorer windows, Add-in Express provides three form-caching strategies: no caching, showing the same form instance for all folders, and showing a new form instance for each folder. This C# Outlook sample addin demonstrates all the strategies. Please note that forms embedded into Outlook Inspector windows are always non-cached. More about customizing Outlook Explorer views.

    Available downloads:
    Sample add-in project for VS 2005   Sample add-in project for VSTO 2005.   Sample add-in project for VSTO 2005 SE.

     


    10.  How to re-size a form embedded into Outlook Explorer or Inspector window

    When a form is embedded into an Outlook window, Add-in Express displays a splitter that allows the user to change the size of the form. That's the behavior by default. For the developer to control the size of the form, the splitter should be made invisible (Splitter = None). This C# add-in for Visual Studio 2005 and VSTO is an example that demonstrates this behavior in Outlook 2000 - 2007.

    Available downloads:
    Sample add-in project for VS 2005   Sample add-in project for VSTO 2005.   Sample add-in project for VSTO 2005 SE.

     


    11.  How to identify the form in an Outlook Advanced Form region in C#

    This C# sample add-in for Visual Studio 2005 and VSTO shows how to identify an instance of the form embedded into an Outlook window. It shows several forms marked with a GUID. When you click on a command bar button (a Ribbon button in an Outlook 2007 inspector), the add-in identifies the currently active form instance and shows its GUID.

    Available downloads:
    Sample add-in project for VS 2005   Sample add-in project for VSTO 2005.   Sample add-in project for VSTO 2005 SE.

     


    12.  How to set the visibility of the form in an Outlook Advanced Form Region

    This C# sample shows how to hide and show the form embedded into Outlook Explorer and Inspector windows.

    Available downloads:
    Sample add-in project for VS 2005.   Sample add-in project for VSTO 2005.   Sample add-in project for VSTO 2005 SE.

     


    13.  How to use events of Reading Pane, Navigation Pane, and To-Do bar

    This C# sample add-in for Visual Studio 2005 and VSTO 2005 demonstrates how you can make use of the events that are missing in Outlook:

    • Show / hide Navigation Pane (FolderList, Outlook Bar)
    • Show / hide / move Reading Pane (Preview Pane)
    • Show / hide / minimize To-Do Bar

    Find more about special features to enhance Outlook bar, To-Do bar, Reading and Navigation panes.

    Available downloads:
    Sample add-in project for VS 2005.   Sample add-in project for VSTO 2005.   Sample add-in project for VSTO 2005 SE.

     


    14.  How to use several forms in one Advanced Form Region

    This sample add-in for VS 2005 and VSTO demonstrates how to use several forms in the same Advanced Form Region. Click a RadioButton on the Controlling form to activate the corresponding ADXOlForm. Find more about the Add-in Express Advanced Outlook Form Region technology.

    Available downloads:
    Sample add-in project for VS 2005.   Sample add-in project for VSTO 2005.   Sample add-in project for VSTO 2005 SE.

     


    15.  How to switch between the standard Outlook explorer view and your custom C# form

    This Outlook add-in example shows how you can switch between the standard Outlook explorer view and and your custom .NET form (ADXOlForm in the WebViewPane layout).

    Available downloads:
    Sample add-in project for VS 2005.   Sample add-in project for VSTO 2005 SE.

     


    16.  How to handle the ItemSend event of MS Outlook in C#

    Download ZIP file

     


    17.  How to scan Outlook folders

    Download ZIP file

     


    18.  How to handle Outlook's SelectionChange event

    Download ZIP file

     


    19.  How to access MAPIFolder from the code of the Outlook property page

    Download ZIP file

     


    20.  How to create and delete hidden Outlook items via Extended MAPI

    This sample VS 2005 solution in C# shows how to get, create and delete a hidden item in Outlook and Exchange with MAPI Store Accessor. For more details see the following article: How to get access to hidden Outlook items via Extended MAPI.

    Download ZIP file

     


    21.  How to handle the ExplorerClose event (Outlook) in C#

    Download ZIP file

     


    22.  How to add custom menu items to the popup menu in Outlook Explorer

    Download ZIP file

     


    23.  How to create a command bar and command bar controls at run time (for Outlook)

    Download ZIP file

     


    24.  How to handle the WorkbookBeforeSave event of MS Excel

    Download ZIP file

     


    25.  How to handle the MouseClick event on presentation's objects (PowerPoint) in C#

    Download ZIP file

     


    26.  How to use dbs as a data source for RTD Servers in C#

    Download ZIP file

     


    27.  How to make an Excel task pane visible / invisible programmatically

    This C# Excel sample shows how to show your custom Advanced Excel Task Pane on the command bar, or how to prevent the task pane from being shown in Excel.

    Available downloads:
    Sample add-in project for VS 2005.   Sample add-in project for VSTO 2005 SE.

     


    28.  How to interact with several Advanced Excel Task Panes in one layout position

    This C# example shows how you can interact with several Excel task panes in one position. Click on a RadioButton control on the Controlling Task Pane to activate the needed ADXExcelTaskPane.

    Available downloads:
    Sample add-in project for VS 2005.   Sample add-in project for VSTO 2005 SE.

     


    29.  How to develop a context-dependent Excel task pane

    The C# sample add-in for Excel 2000 - 2007 shows how to dynamically show and hide an Advanced Excel Task Pane depending on whether cell A1 contains or doesn't contain any string.

    Available downloads:
    Sample add-in project for VS 2005.   Sample add-in project for VSTO 2005 SE.

     


    30.  How to re-size an Excel task pane programmatically

    This C# example for Excel shows how to change the size of an Excel task pane programmatically. There are two possible ways depending on the visibility of the splitter (as set by the developer): if the splitter is visible, the user can change the size of the Excel task pane and the developer can not. To change the Excel task pane size programmatically, the developer sets the Splitter.Visible property to false. Find more about Advanced Excel Task Panes provided by Add-in Express.

    Available downloads:
    Sample add-in project for VS 2005.   Sample add-in project for VSTO 2005 SE.

     


    31.  How to handle the FrontPage OnWindowActivate event

    Download ZIP file

     


    32.  How to handle the TaskChange event of MS Project in C#

    Download ZIP file

     


    33.  How to change the CommandBarComboBox (TadxCommandBarComboBox) properties at run time

    Download ZIP file

     


    34.  How to disable Outlook security in a COM add-in?

    Disables the Outlook security guard and shows contacts and message details.

    Download ZIP file

     


    35.  How to disable Outlook security in a standalone application?

    This C# WinForms application disables the Outlook security guard and sends messages using a custom form.

    Download ZIP file

     


    36.  How to disable security warnings which show up when I use the Outlook object model, CDO, or Simple MAPI?

    This sample turns off the Outlook, Simple MAPI and CDO security and shows the info of the first email.

    Download ZIP file

     


    37.  How to create a custom toolbar in Excel?

    Download ZIP file

     


    38.  How to show a toolbar for Outlook mail items only?

    This C# sample add-in demonstrates creating explorer and inspector command bars for mail and task items, shows a property page. The VSTO edition of this add-in adds two option pages to Outlook.

    Available downloads:
    Version for VS 2005 (Office 2000-2007)   Version for VSTO 2005 SE (Office 2003-2007)

     


    39.  How to add a context menu item to the context menu of Outlook explorer?

    Available downloads:
    Version for VS 2005 (Office 2000-2007)   Version for VSTO 2005 SE (Office 2003-2007)

     


    40.  How to add a property page to the Tools | Option menu in Outlook?

    Available downloads:
    Version for VS 2005 (Office 2000-2007)   Version for VSTO 2005 SE (Office 2003-2007)

     


    41.  How to process Open, Read, Reply, ReplyAll, Send, etc events for a mail, task, appointment, etc in Outlook?

    This C# add-in shows how to use the Outlook Item Events class to process the events of an Outlook item.

    Available downloads:
    Version for VS 2005 (Office 2000-2007)   Version for VSTO 2005 SE (Office 2003-2007)

     


    42.  How to determine if an item was added to, changed in, or removed from a given Outlook folder(s)?

    This example shows on how to use the Outlook Items Events class and process the ItemAdd, ItemChange, and ItemRemove events of the Items collection of the MAPIFolder interface.

    Available downloads:
    Version for VS 2005 (Office 2000-2007)   Version for VSTO 2005 SE (Office 2003-2007)

     


    43.  How to determine if an Outlook folder was created, moved, deleted?

    This C# example shows how to use the Outlook Folders Events class and process the FolderAdd, FolderChange, and FolderRemove events of the Folders collection of the MAPIFolder interface.

    Download ZIP file

     


    44.  How to create a simple RTD server?

    Sample for VS 2005, Office 2002-2007

     


    45.  How to create a simple Smart Tag?

    Sample for VS 2005, Office 2002-2007

     


    46.  How to implement a custom recognizer for a Smart Tag?

    This example shows how to use the Recognize event of the Add-in Express Smart Tag component.

    Sample for VS 2005, Office 2002-2007

     


    47.  How to create a simple Excel Automation add-in in C#?

    This C# sample add-in adds a simple function to the Excel worksheet that returns a string value.

    Sample for VS 2005, Office 2002-2007

     


    48.  How to process Change, SelectionChange, and other events of the Excel Worksheet class?

    Shows how to use the Add-in Express Excel Worksheet Events class to process the Change event of the Excel worksheet.

    Sample for VS 2005, Office 2000-2007

     


    49.  How to create an Excel document level add-in in C# ?

    This is a simple implementation of a timesheet using MSForms controls.

    Download ZIP file

     


    50.  How to create a Word document level add-in?

    This is a simple implementation of a fax form using MSForms controls.

    Download ZIP file

     


    51.  How to add a custom .NET control onto an Office toolbar?

    Download ZIP file

     




    Client login

     

    Login 

    Password 

     

    Remember me

    Forgot my password