unable to ungroup a shape and then read the text of that ungrouped shape with ps

Started by fvenezia65, January 13, 2020, 09:45:11 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

fvenezia65

hi, everyone.
i am able to read the text of all the shapes in a visio file, except for text in any shape that is "grouped".
i do seem to be able to loop through all the shapes and ungroup the "grouped shapes", but i haven't hit on the technique to re-read the ungrouped shapes and then find the text i am after.
any ideas?
i am using powershell and the visio PS module version 2.25.0 along with Visio-2013.
thank you!
-frank

Paul Herber

There is no need to ungroup shapes. Ungrouping shapes breaks them and any text in the group part is lost. Read the group's sub-shapes. The group has a Shapes.Count > 0

Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

fvenezia65

Thank you, Paul.
The funny thing is...i can ungroup the shape with the text i am after, and then save the file.
when i pass the ungrouped file to my script, it can then find the text.
i will try that count property.
have a great weekend!
-frank

Paul Herber

Do not ungroup shapes, it does not help and breaks the shape, permanently. Any properties of the top-level shape are then lost.
You need to recurse down through the sub-shapes, the text may be in any one or more of the sub-shapes, could be several layers down.
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/