ComboBox in visio

Started by RedtoGreen, December 21, 2009, 11:56:09 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jumpy

OK, you seem to hit all the big Visio issues. I'm not so good in Visio to answer your question correct, jet, but some guesses:

1) The org chart wizard, like all original Visio-AddOns does, works like it wants and is somewhat mistyrious. It may be, that he ignores every tempering at the masters in the stencil, or undoes them. If you delete the original manager and then rename your manager.2 to manager, look in this new manager master in the stencil. Is it yours? Has it your changed properties? If it is still your's, drop it on the page manually. Does it change than? Or only when the wizard makes the drop?

2) Another possibility. It is sth. about the names of masters. If you have dropped an old master on the page. And then drop a new one with the renamed master (with the same name now than the old master), then while dropping Visio looks at the document stencil of your drawing and if there exists a master with this name already it makes a new instance (=shape) on the page, basing on this (old) master instead of the new one. But this is somehow adjustable. Somewhere you can change this so, that Visio somehow identifies that this new master although it has the name of the old one, is something different and places this new master in the document stencil, too, and then creates an instance (=shape) of this new master on the page. I don't know the the name of this behavior or where to change it, but there exists sth. like this.
Try it with a new blank page without any masters in the document stencil and only your new manager master in the stencil.

RedtoGreen

#16
Just to keep you readers up-to-date... It is now for the most part working.  I managed to get it working by re-starting Visio (hence having a blank Document Stencil).  My new manager shape (within a custom stencil) then works fine, and is used automatically by the org chart wizard.  I suspect simply deleting entries from the Document Stencil direct would work fine too.  (The reason it wasn't working before, is that the previous Manager shape was in the document stencil, so was over-riding my custom shape)

Only thing I'm now working on is getting a long piece of code to be accepted within this new Master shape in the FillBackground cell.  (the "IF(ThePage!..." code as above).  Which isn't working.   :-\  Why doesn't it just work??

RedtoGreen

#17
Houston we no longer have a problem  :)

It's now working.  I have my full multi-page org chart, and the right click changes the backgrounds of the shapes.  I got around the problems I've been having with inserting code in Masters, by doing the following (only for interest, to round off this thread).  1)Drag+Drop Manager shape from Document Stencil to page.  2)edit shape with my code in FillBckGnd 3) Move new shape back to Document stencil, delete previous shape, and re-name new shape to the same name as the old shape 4)copy shape to custom stencil 5)save all stencils and templates.  ta da.

However, all of this only changes the SelectionNumber property for each individual page of the org chart.  (ie one page could be on nationality, another on trained, and a 3rd on normal).  Is it possible to change things slightly so that selecting a different SelectionNumber will result in all shapes on all pages changing?  My org chart will/may eventually be many pages so would be better to have this automatic)

Jumpy

You can make this in the shapesheets only, but would be very complicated.
Better via VBA.

You need one new cell in every pages ShapeSheet.
User.XYZ with: =DEPENDSON(User.SelectionNumber)+CALLTHIS("Name_of_new_VBA_Sub")

This will start the new Sub whenever User.Selection number changes.
Then the Sub must start like:

Sub Name_of_new_VBA_Sub(shp As Visio.Shape) or (pg As Visio.Page)

Normaly I start a Sub from a Shape and with Callthis the Sub gets a reference to this shape, stored in shp As Visio.page
But I don't know how it is, when I use CallThis in a page. Maybe the MVPs can explain.

In the Sub read out the formula of the custom properties row, store it in a String, than loop through all pages and set the cusom properties row formula = the String.