Developing an outlook helper–part 3 from 5–C# project

Series

 

Developing Outlook helper – introduction

Developing Outlook helper-VBA macro

Developing Outlook helper-C#

Developing Outlook helper – javascript for Office 365

Developing Outlook helper – conclusions

Develop like it was  200x:

Start  Visual Studio. See that you do not have the project. Download the Office addon for VS that create the project. Find the Outlook project – that is a wizard and let you have some choices . Give a name and wait for Visual Studio to load all files.

Those are the files generated by VS2013 ( differs from version to version)

app.config
Properties
Resources
ThisAddIn.cs
ThisAddIn.Designer.cs
ThisAddIn.Designer.xml
FindInEmail.cs
FindInEmail.Designer.cs
FindInEmail.resx
FindInEmailIn.csproj
FindInEmailIn.csproj.user
FindInEmailIn.sln
FindInEmailIn_TemporaryKey.pfx
FindSettings.cs
FindSettings.Designer.cs
FindSettings.resx
.vs\FindInEmailIn
.vs\FindInEmailIn\v14
Properties\AssemblyInfo.cs
Properties\Resources.Designer.cs
Properties\Resources.resx
Properties\Settings.Designer.cs
Properties\Settings.settings

After a while, you realize that you want a button in the ribbon.  You will find eventually the http://www.visualstudioextensibility.com/ site where Carlos Quintero maintains various blog posts about that and understand how to add the ribbon button and how to intercept clock event . Then you wrote more or less the same code as in part 2 :

var m = Globals.ThisAddIn.Application.ActiveInspector().CurrentItem;
MailItem mi = m as MailItem;
if (mi == null)
      return;
//C# same code as in http://msprogrammer.serviciipeweb.ro/2017/01/30/developing-an-outlook-helperpart-2-from-5vba/ 

Test like it was 200x:

Press F5 to run the project. Outlook starts and loads the plugin. So now there are 2 resource hogs on your system: Outlook + Visual Studio. Set break point in VS . Open the email. Find the ribbon in Outlook. Press the button and debug.

Deploy like it was 200x:

Create a VS Setup project and pray

    1. user have the same .NET Framework version that you have developed with
    2. user have the same  Outlook version that you have developed

( There are solution for 1 and 2 to be integrated – but it requires some programming / settings)