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.
private static void Connect(bool bStatus)
// More code
objComAddin.Connect = bStatus;