Author Topic: unable to ungroup a shape and then read the text of that ungrouped shape with ps  (Read 658 times)

0 Members and 1 Guest are viewing this topic.

fvenezia65

  • Newbie
  • *
  • Posts: 2
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

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3084
    • Paul Herber's website
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 and applications for Visio -

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

fvenezia65

  • Newbie
  • *
  • Posts: 2
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

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3084
    • Paul Herber's website
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 and applications for Visio -

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