Getting started????

Sep 22, 2013 at 4:08 PM
Edited Sep 22, 2013 at 4:39 PM
I have a couple of Outlook 2010 addins I want to convert to Netoffice. The reviews look great, however nowhere does it seem to tell you how to use it? e.g. I want to create an Outlook addin using NetOffice, how do I start? Windows forms project? Addin? then what Libraries to I use?

The examples are OK but that doesn't tell me how I create my own project. The documentation seems to be like an overview rather than product specific.

Does anyone have a quickstart tutorial?

thanks
Rim
Developer
Sep 23, 2013 at 6:32 AM
Edited Sep 23, 2013 at 6:39 AM
The simplest way is to use Project wizard from NetOffice Developer Toolbox. If you prefer to create own project from scratch do the following:
  1. Create a class library (as Outlook addin should be a DLL)
  2. Add reference to extensibility.dll (for implementing IDTExtensibility2 interface)
  3. Add references to NetOffice assemblies: OutlookApi.dll, OfficeApi.dll, NetOffice.dll
  4. Implement IDTExtensibility2 interface
  5. Write your addin logic
Sep 23, 2013 at 2:38 PM
Edited Sep 23, 2013 at 3:16 PM
Brilliant thanks

No 4 - you mean "public class Addin : COMAddin" ?
Developer
Sep 24, 2013 at 5:41 AM
COMAddin seems to be a VSTO wrapper. As Visual Studio itself (without Tools for Office) and NetOffice know nothing about it no. 4 should be like this:
using Extensibility;

public class Addin :IDTExtensibility2
{
  void IDTExtensibility2.OnStartupComplete(ref Array custom)
  {
  }

  void IDTExtensibility2.OnConnection(object Application, ext_ConnectMode ConnectMode, object AddInInst, ref Array custom)
  {
     _application = new Outlook.Application(null, Application);
  }

  void IDTExtensibility2.OnDisconnection(ext_DisconnectMode RemoveMode, ref Array custom)
  {
    if(null != _application)
    {
      _application.Dispose();
      _application = null;
    }
  }

  void IDTExtensibility2.OnAddInsUpdate(ref Array custom)
  {
  }

  void IDTExtensibility2.OnBeginShutdown(ref Array custom)
  {
  }
}
Sep 27, 2013 at 3:26 PM
Oh? The Netoffice project tool doesn't create that in the project it creates public class Addin : COMAddin

Confused now????
Coordinator
Sep 29, 2013 at 9:47 PM
hello,

the COMAddin base class (and the tools namepsace) is new in NO 1.6. its no a VSTO wrapper but i want keep it very similar.
the normal way is to implement the IDTExtensibility2 interface and spend 2 static register/unregister methods.
This is just the plain way for alle the years since Visual Basic 4 to extend MS-Office.
The COMAddin base class can help to reduce infrastructure code in your project. just inherite from COMAddin and add some attributes.
Currently, the toolbox doesnt generate COMAddin projects (but its done and available in NO 1.6.1)
Any COMAddin Examples folder (coresponding to the office product) has 2 addin examples. "NetOffice Tools - Simple" and "NetOffice Tools - Extended" with code comments that show you how to use the COMAddin class.

*Sebastian