Visio VBA - How do I get the title and subtitle of a state shape (UML) -
i want shape information out of state (uml standard stencil). can see in picture title "aktiv" , "eintritt/" etc. have no clue variable.
edit: make clear, don't know how can information out of uml shape in visio. here example code:
private sub test() dim s shape dim vsopage visio.page dim getstatename string 'i need name example "aktiv" state 'and name of "sub" information "eintritt" etc. set vsopage = thisdocument.pages(1) each s in vsopage.shapes getstatename = s.???? next s end sub
okay found solution, don't know if there nicer 1 though.
private sub test() dim s shape dim vsopage visio.page dim getstatetitle string dim getstatesubtitle string set vsopage = thisdocument.pages(1) each s in vsopage.shapes if contains(s) = false 'not stateshape else getstatetitle = getstatetitle & s.shapes.item(1).text & vbcrlf getstatesubtitle = getstatesubtitle & s.text & vbcrlf end if next s end sub
with
public function contains(s shape) boolean dim dummystring string on error goto err contains = true dummystring = s.shapes.item(1) exit function err: contains = false end function
so state shape contains 2 shapes can information item 1 or 2.
Comments
Post a Comment