Visio Guy

Visio Discussions => ShapeSheet & Smart Shapes => Topic started by: Hellboy on May 12, 2018, 07:48:02 AM

Title: Why "IF" doesn`t work for User.msvStructureType property?
Post by: Hellboy on May 12, 2018, 07:48:02 AM
I have a list with header shape.
I try to add action to list to hide list header (use RMB on a list to see Hide header row).
I want not only to hide header shape but to exclude it from calculations of listItems positions.
I decide to do this by means of formula for header shape property User.msvStructureType=IF(User.Hide,"","Heading"), but it doesn`t work (value is evaluated but there is no result, list items overlap header). To update list change text of list item or add/remove any item (I don`t know another way to update list).
If I set this property to "" or "Heading" manually, everything is OK, but "IF" function doesn`t work and I don`t understand why.
The file with shape is attached.
Title: Re: Why "IF" doesn`t work for User.msvStructureType property?
Post by: Nikolay on May 12, 2018, 09:21:18 AM
Because dynamic switching shape into container/list is most probably not supported.
It is like trying to hide car's wheels by transforming it into a ship with a button click.
Might be possible for Optimus Prime, but i doubt it will work in Visio.
Title: Re: Why "IF" doesn`t work for User.msvStructureType property?
Post by: Visio Guy on May 12, 2018, 11:32:40 AM
Maybe instead of changing the type away from "Heading", just make the size of the heading shrink to zero.

You can hide the text too using the Miscellaneous.HideText cell.

That way, it doesn't matter that the heading is still there, since its size will be zero, and all of its bits will be hidden.

Will that work?
Title: Re: Why "IF" doesn`t work for User.msvStructureType property?
Post by: Hellboy on May 12, 2018, 11:42:40 AM
shrink size to zero doesnt help,because pin point is still there,but I can move header outside of list group.
Title: Re: Why "IF" doesn`t work for User.msvStructureType property?
Post by: Hellboy on May 12, 2018, 04:49:36 PM
But it works for User.msvSDContainerHeadingEdge property :).
Thank you for all of you.
Title: Re: Why "IF" doesn`t work for User.msvStructureType property?
Post by: wapperdude on May 13, 2018, 01:27:36 AM
I don't have V2016, so, can only suggest without testing.  Suggestion, move the "IF" statement to either a scratch cell or to a new user cell.  Then use "setf" constructs in the true and false results to write the result into the User.msvStructureType cell.

So, your IF statement would be something like this:
IF(User.Hide,setf(getref(User.msvStructureType),""),setf(getref(User.msvStructureType),"Heading"))

This ought to avoid the problem you're having since it preserves the expected syntax for the StructureType cell.

Wapperdude