Sub alignTextObjectRight(oShape As Object, dir%) If oShape.supportsService("com.sun.star.drawing.TextShape") Then oShape.TextHorizontalAdjust = dir End If End Sub Function isComplex(str$) As Boolean 'Checks if a string has complex text anywhere in the string DIM scriptType%, i% DIM brk brk=createUnoService("com.sun.star.i18n.BreakIterator") For i = 0 to Len(str) -1 scriptType=brk.getScriptType(str$,i) isComplex = (scriptType = com.sun.star.i18n.ScriptType.COMPLEX) If isComplex Then Exit Function End If Next End Function Sub alignRtlTextObjectsRight Dim oPage, i%, s$, j% Dim oShape oPage = ThisComponent.getDrawPages() For i = 0 To oPage.getCount()-1 For j = 0 To oPage(i).getCount()-1 oShape = oPage(i).getByIndex(j) s$ = oShape.GetString() If Not isNull(s$) AND isComplex(s$) Then If oShape.supportsService("com.sun.star.drawing.TextShape") Then alignTextobjectRight(oShape, com.sun.star.drawing.TextHorizontalAdjust.RIGHT) End If End If Next Next End Sub