![Citation](https://forum.developpez.be/images/misc/quote_icon.png)
Envoyé par
nouvelinscrit
1 2 3 4 5 6 7 8 9 10 11 12
| Dim i As Integer
Dim previousStyle As String
For i = 1 To ActiveDocument.Paragraphs.Count
If ActiveDocument.Paragraphs(i).Style = previousStyle Then
If Selection.Characters.Count = 0 Then
Selection.Delete Unit:=wdCharacter, Count:=1
End If
End If
previousStyle = ActiveDocument.Paragraphs(i).Style
Next i |
Bonjour,
If Selection.Characters.Count = 0 Then
Il faut tester le nombre de caractères du paragraphe comme suit :
If ActiveDocument.Paragraphs(i).Range.Characters.Count=1 then
Si le paragraphe est une ligne vide => 1 seul caractère
Partager