Get master page shapes handle in macro

I have been trying to create a libreoffice impress presentation by making a macro which reads ASCII files and writes them onto the slides. This works, and now I want to add formatting by using premade master slides, using the TextShape’s from the master slide.

I believe can get the master pages using:


but how can i get the shapes within, eg. a TitleTextShape and add them to a page?

I found out one can link a master page to a drawpage using