After connecting to a document I have this code:
page = document.getDrawPages().getByIndex( 0 )
textshape = document.createInstance('com.sun.star.drawing.TextShape')
textshape.setSize(Size(150, 150))
textshape.setPosition(Point(100, 100))
textshape.setString('Test')
textshape.CharColor = 0
textshape.CharHeight = 12
page.add(textshape)
The code does not give an error, but nothing happens.
What is the proper way to add a TextShape to a document with Python?