Important: the case of MTEXTs on several lines is NOT contemplated in the code
That is to say: the code will only work well with MTEXTs that contain all their text on a single line
Hi I think you should create a function that converts any TEXT or MTEXT into center-justified text.
If it's a text, change its 'alignment' property to 'acAlignmentCenter'.
And, if it's an MTEXT, create a new text, set its 'alignment' property the same way and delete the original MTEXT.
Then the rest will be easy