Automating Outlook w/ VSTO module installed

Add-in Express™ Support Service
That's what is more important than anything else

Automating Outlook w/ VSTO module installed
 
Rick Koch




Posts: 172
Joined: 2006-09-05
Say I'm using OLE to automate Outlook, and the user has an Add-in built with the .Net/VSTO product. (The add-in is really an agent of the application that's doing the automation, just so you know we're all on the same team here.) In this case I'm going to start or connect to Outlook, create a new (unsaved) appointment, and use GetInspector to open the item for display.

At this point I want to disable one of the ADX-associated commandbar buttons which will be enabled by default. Note that I am not trying to do this from Outlook Addin code, but rather from automation code in an external calling app.

So how do I turn off the button? Can I just get the underlying commandbar button (by name) from the inspector in my external code, or is there a way to reach it through its ADX identity?

As a third alternative, I'll be setting some values on the appointment before opening it in an inspector, and I could rig up a special property to indicate to the add-in that the button should be disabled.

Just wondering what's the best way.
Posted 03 Nov, 2006 11:54:39 Top
Sergey Grischenko


Add-in Express team


Posts: 7224
Joined: 2004-07-05
Hi Rick.

I think the best way is to disable the button.
You can find the button using the FindControl method of the CommandBars interface.
Posted 03 Nov, 2006 12:25:09 Top