Conditional Loading of Toolbar/Menu

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

Conditional Loading of Toolbar/Menu
Can you define logic that determines if a toolbar or menu loads? 
Jack Bretcher




Posts: 189
Joined: 2006-06-30
I have an application that I need to integration with another, if it exists on a specific machine. The idea is this, if a condition is true then add my function to an existing toolbar, if not create a new menu.

Jack
Posted 12 Oct, 2006 09:48:30 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Jack.

Please download an example that shows how you can create command bars/controls dynamically in the code of the add-in:
http://www.add-in-express.com/projects/oldynamiccontrolsexample-vs2005.zip
You can use this example to develop the code that adds menus/controls depending on a condition.
Posted 12 Oct, 2006 12:04:06 Top
Jack Bretcher




Posts: 189
Joined: 2006-06-30
So I understand how this works. You add an OutlookEvents, then trapped in the new Inspector/Inspector Activate and then manually created the command bar.

So in my case I would not use the UI to create the commandbar/menu but on the add-in startup event I would manually create the commandbar/menu, correct?

Jack
Posted 12 Oct, 2006 13:18:34 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05

Yes, correct.
Posted 12 Oct, 2006 17:34:07 Top
Jack Bretcher




Posts: 189
Joined: 2006-06-30
Sorry, one last follow-up. Once I put the conditional logic I cannot go back to the design view, I must work with code view. Correct?

Jack
Posted 12 Oct, 2006 17:48:16 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Jack.

There are two ways to implement your idea.
1. You add all command bars and controls at the design time and then show/hide them when you want.
2. You add all command bars and controls dynamically at the runtime.

Of course, you can mix these two ways and add a part of your comamnd bars and controls at the design time and other controls at the runtime.
Posted 13 Oct, 2006 09:01:54 Top