Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. What do I put in a VSTO Outlook Add In shutdown handler?

What do I put in a VSTO Outlook Add In shutdown handler?

Scheduled Pinned Locked Moved C#
questionasp-netvisual-studiohelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    justastupidgurl
    wrote on last edited by
    #1

    I'm writing my first VSTO Outlook add-in. Basically "Hello World". It's VS 2008 targeting Outlook 2007. It's a standard MS VS build/publish. In the startup handler I've got:

    try
    {
    Office.CommandBar commandBar = activeExplorer.CommandBars["Standard"];
    button = (Office.CommandBarButton)commandBar.Controls.Add(1, missing, missing, missing, missing);
    button.Style = Office.MsoButtonStyle.msoButtonCaption;
    button.Caption = "TEST";
    button.Tag = "btnProcess";
    //button.Click += new Microsoft.Office.Core._CommandBarButtonEvents_ClickEventHandler(button_Click);
    return true;
    }
    catch (ArgumentException e)
    {
    MessageBox.Show(e.Message);
    }

    'button' is a local Office.CommandBarButton object. It installs nicely and puts a 'TEST' button on the standard toolbar as expected. But when I uninstall via Control Panel, the button is still there when I restart Outlook. I guess I need something in the shutdown handler to kill the button - but what? Office.CommandBarButton class does not have a dispose event. How come the button is still there after uninstallation, and how do I solve that? I'm a bit confused here. Help!

    JustAStupidGurl

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups