Visio Guy

Visio Discussions => Programming & Code => Topic started by: Naresh Nichani on May 11, 2009, 12:50:13 PM

Title: Space Plan
Post by: Naresh Nichani on May 11, 2009, 12:50:13 PM
Hi,

When the Space Plan add-on is enabled a custom menu I add to the main "Menu Bar" command bar disappears. If this Space Plan is disabled and I reopen my drawing it works.

Questions -
1. Is there a way to detect if a Visio drawing has the Space Plan add on enabled so I can warn users to disable it.
2. Could there be something I do different in my code to prevent my menu from disapearing.

Any tips, pointers appreciated.

Naresh
Title: Re: Space Plan
Post by: Visio Guy on May 11, 2009, 03:10:55 PM
Hi Naresh,

Perhaps use the UI object model instead of CommandBars? Visio ui customizability is pretty sophisticated, and CommandBars are kind of dumb, as far as I have seen. They are very global, and not solution-oriented.

There may be a way to get the CommandBars to work properly, but I haven't worked with them for some time.

Anyway, with the UI model, you get a sort of "tree of customized uis":

Visio's default menus and toolbars
Custom menus and toolbars
- Document's default menus and toolbars
- Custom document menus and toolbars

The trick is to add your customizations to the customized document ui (if it exists, ie: if it is customized). That way you'll keep anybody else's customizations.

There is probably a NoEventsPending angle on this as well - don't add anything until everybody else is finished.

I haven't worked with this for awhile, so my off-the-top-of-my-head knowledge is a bit vague. Hope this gives you some direction, anyway.
Title: Re: Space Plan
Post by: Naresh Nichani on May 14, 2009, 11:10:43 AM
Chris,

Thanks - that helps. Will check it out.

Naresh