Find next horizontal text shape

Good Morning,

I have written code (in base) which opens an ODG file. From this file find the page that contains a text shape which has any string with the substring being GEOLOGIST. I have successfully coded that. However my problem is that I also need to access the adjacent text shape to the right. This adjacent text shape contains a value that i need. The problem is that the shapes are not indexed in any particular order so looping could be a problem. If there is a way to find the the next shape to the right, or find the shape at a certain position of contains the position, that would help me solve my problem. Thank you for your assistance.

Current version of LO is

Version: (x86) / LibreOffice Community
Build ID: a69ca51ded25f3eefd52d7bf9a5fad8c90b87951
CPU threads: 8; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL

You can browse (by a macro loop) all of the graphical objects and examine the Position and Size values of the actual item. If the pairs are located closely, then the PositionX+SizeX will determine the PositionX of the adjacent object. If the actual item in the loop has such PositionX value, then you found it.

1 Like

Yes that would only make sense. Thank you.