https://bugs.documentfoundation.org/show_bug.cgi?id=151889
--- Comment #16 from Rafael Lima <rafael.palma.l...@gmail.com> --- Hi Orwell, can you please test if this macro does what you need? Sub ClearEverything ' Get the current selection Dim oSel as Object oSel = ThisComponent.CurrentSelection ' Dispatch helper to use the CDF command Dim oProvider as Object Dim oDispHelper as Object oProvider = ThisComponent.CurrentController.Frame oDispHelper = CreateUnoService("com.sun.star.frame.DispatchHelper") ' First of all apply the CDF command to the entire selection oDispHelper.executeDispatch(oProvider, ".uno:ResetAttributes", "", , Array()) ' Traverse all text ranges Dim rangeCount as Integer, i as Integer Dim oEnum as object, oElement as Object rangeCount = oSel.getCount() For i = 0 To rangeCount - 1 ' Traverse all text elements oTextRange = oSel.getByIndex(i) oEnum = oTextRange.createEnumeration() Do While oEnum.hasMoreElements() oElement = oEnum.nextElement() With oElement ' Clear paragraph style .ParaStyleName = "Default Paragraph Style" ' Cleat character style .CharFontStyleName = "" .CharFontStyleNameAsian = "" .CharFontStyleNameComplex = "" .CharStyleName = "No Character Style" ' Clear list format .ListId = "" .NumberingIsNumber = False .NumberingStyleName = "" End With Loop Next i End Sub -- You are receiving this mail because: You are the assignee for the bug.