Wednesday, April 04, 2012

Enabling and disabling Office Addins programatically using C#

The following code is an example for enabling / disabling Outlook addins.

I have used the Interop.Outlook as I was developing for Outlook. If you want to do this for other Office applications, eg, Word , Excel, Powerpoint, please reference the respective interop.

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Office.Core;
using Microsoft.Office;
using Microsoft.Office.Interop.Outlook;

private static void Connect(bool bStatus)
  // More code
objComAddin.Connect = bStatus;


No comments :