Public Sub Tableau()
On Error Resume Next
Dim oTable As Table
Dim oRow As Row
For Each oTable In ActiveDocument.Tables
For Each oRow In oTable.Rows
If LigneVide(oRow) Then
oTable.Rows(oRow.Index + 1).Cells(1).Range.Style = "Titre 2"
End If
Next oRow
Next oTable
End Sub
Public Function LigneVide(Rang As Row) As Boolean
' Teste si une ligne d’un tableau est vide
Dim oCell As Cell
LigneVide = True
For Each oCell In Rang.Cells
If Len(oCell.Range.Text) <> 2 Then
LigneVide = False
Exit For
End If
Next oCell
End Function
nb : une cellule vide de tableau est en réalité composée d'un retour paragraphe Chr(13) et d'une sorte d'espace Chr(7), donc de deux caractères.