REM ***** BASIC ***** rem Code08-04.odt bibli : Remplacer Module3 Option Explicit Sub RemplacerAttributs() Dim MonDocument As Object Dim JeCherche As Object Dim MonCurseur As Object Dim attRech(0) As New com.sun.star.beans.PropertyValue Dim attRempl(3) As New com.sun.star.beans.PropertyValue attRech(0).Name = "CharUnderline" attRech(0).Value = com.sun.star.awt.FontUnderline.WAVE attRempl(0).Name = "CharPosture" attRempl(0).Value = com.sun.star.awt.FontSlant.ITALIC attRempl(1).Name = "CharUnderline" attRempl(1).Value = com.sun.star.awt.FontUnderline.NONE attRempl(2).Name = "CharWeight" attRempl(2).Value = com.sun.star.awt.FontWeight.BOLD attRempl(3).Name = "CharBackColor" attRempl(3).Value = 1234567 ' fond vert sombre MonDocument = ThisComponent JeCherche = MonDocument.createReplaceDescriptor with JeCherche .SearchString = "ses" .ReplaceString = "ses" ' on ne change pas le texte .SearchWords = True .ValueSearch = True .SearchAttributes = attRech() .ReplaceAttributes = attRempl() end with MonDocument.replaceAll(JeCherche) End Sub