Author Topic: Visio 2010 Ribbons  (Read 7120 times)

0 Members and 1 Guest are viewing this topic.

AndyW

  • Sr. Member
  • ****
  • Posts: 326
    • PC Mimic Diagram
Visio 2010 Ribbons
« on: December 03, 2009, 07:11:32 AM »
I thought I would give the Visio 2010 Beta a try.

My application does a lot of cutomisation and hiding of command bars etc. This no longer seems to work with the advent of ribbons. Anyone know if its possible to keep the old style in place of ribbons or do I have to completely rewrite the handling to cope with ribbons. (My application is built into a visio diagram plus VB dll and is not an add-in).

How do I maintain one version of my application that has to work across 2003 and 2007 if there are new functions etc to handle ribbons. Development of my application is on going but will have lots of customers who get updates that will not move from 2003 in the near future.

 :o
Live life with an open mind

Visio Guy

  • Administrator
  • Hero Member
  • *****
  • Posts: 1734
  • Smart Graphics for Visual People...n' Stuff
    • Visio Guy
Re: Visio 2010 Ribbons
« Reply #1 on: December 04, 2009, 02:02:02 PM »
Hi Andy,

You can check Visio versions and make some decisions that way.

This doesn't work as well with VBA, because you can get the problem where the code won't "compile" in older versions, but if you have separate exes/dlls, etc. it should work. I'm sure there are some finer wrinkles that I haven't thought of, but at least app.Version is a place to start.
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

Barry

  • Jr. Member
  • **
  • Posts: 18
Re: Visio 2010 Ribbons
« Reply #2 on: December 05, 2009, 01:48:22 PM »
Andy,

Since your addon is VBA-based, you can take advantage of the new 'Document.CustomUI' property.  Stuff your Ribbon customizations into this property (it's a RibbonX XML string), save the file, then reopen it.  Visio 14 will apply the customizations whenever the document is active.  Previous versions naturally will ignore this property and still expect you to use the CommandBars or UI Object Model to plug in your UI.  You then just need to wrap your commandbar-based code with an app version check as mentioned earlier.

Note: the Document.CustomUI property is very picky.  If you get anything wrong in the XML, *none* of your customizations will appear.  Also remember that after setting Document.CustomUI, you must save and reopen the file to see the customizations.  Visio applies them at doc open time *only*.

Barry