According to the screenshot, you need to recognize MS Visio shapes. I suggest that you try using MSAA. This should expose the objects you need. Refer to the Testing With Microsoft Active Accessibility article for details.
-- Dmitry Nikolaev
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️