Visio Guy

Visio Discussions => Shapes & Templates => Topic started by: bakervisgal on November 13, 2012, 09:17:51 PM

Title: Multi-Select in a Shape Attribute Variable List
Post by: bakervisgal on November 13, 2012, 09:17:51 PM
Greetings! I have a lot of shape attributes and for one particular attribute I have set the type to a variable list with a list of names. Is there a way in Visio to have the ability to select multiple names in this attribute and Visio would create a list based on that selection. For example, if my variable list is:

John
Stephen
Joseph
Kimmy


and I want the value to be Stephen;Joseph, how would I go about doing that without just typing it into a String?

Help is greatly appreciated!
Title: Re: Multi-Select in a Shape Attribute Variable List
Post by: Jumpy on November 14, 2012, 08:49:31 AM
I fear there's no way to do that with the ShapeData dialog. There's no multiselect. You would have to create your own dialog using VBA and a form.
Title: Re: Multi-Select in a Shape Attribute Variable List
Post by: bakervisgal on November 15, 2012, 10:51:21 PM
Ok thanks so much! Quick question...

So I created a VBA form that is a multi-select listbox. All of my code works except I can't seem to set the value of the Shape Data Cell to the String that I grab from the listbox. I'm using the follow line below but I keep getting an error. Any idea?

vsoShape.CellsU("Prop.Actor_Responsible").FormulaU = "actor"


where actor is a String variable that I have populated with a String from the listbox.

Thanks again!
   
Title: Re: Multi-Select in a Shape Attribute Variable List
Post by: Jumpy on November 16, 2012, 08:01:55 AM
If actor is a String-Variable:

vsoShape.CellsU("Prop.Actor_Responsible").FormulaU = CHR(34) & actor & CHR(34)

(CHR(34) Adds the "" to the String without confusing VBA.)

If "actor" were not a variable, but String itself you'ld use:

vsoShape.CellsU("Prop.Actor_Responsible").FormulaU = CHR(34) & "actor" & CHR(34)
Title: Re: Multi-Select in a Shape Attribute Variable List
Post by: bakervisgal on November 26, 2012, 09:40:23 PM
Thank you so much! This works perfectly :)