Macro VBA pour Modifier le Tableau des Couleurs

J'ai un document Word qui contient plusieurs tables. Je voudrais être en mesure de sélectionner la table (ou d'une cellule dans le tableau) et d'avoir chaque ligne de la table de couleur en alternant les couleurs. Jusqu'à présent, j'ai créé le code suivant:

Sub ColorTable()
    '
    ' ColorTable Macro
    ' Alternately colors cells.
    '
    Selection.Collapse Direction:=wdCollapseStart
    If Not Selection.Information(wdWithInTable) Then
          MsgBox "Can only run this within a table"
          Exit Sub
    End If
    Dim RowCount, i, count, ColCount As Integer
    RowCount = ActiveDocument.Tables(1).Rows.count
    i = 0
    ColCount = ActiveDocument.Tables(1).Columns.count
    For i = 1 To RowCount
        For count = 1 To ColCount
            Selection.Shading.BackgroundPatternColor = RGB(184, 204, 228)
            'light
            Selection.MoveRight Unit:=wdCharacter, count:=1
        Next count
        Selection.MoveDown Unit:=wdLine, count:=1
        For count = 1 To ColCount
            Selection.Shading.BackgroundPatternColor = RGB(219, 229, 241)
            'dark
            Selection.MoveRight Unit:=wdCharacter, count:=1
        Next count
    Next i
End Sub

La Macro s'exécute sans erreur, mais les changements de la cellule de couleurs en diagonale. Je suppose que le problème se trouve dans mes boucles for.

InformationsquelleAutor ale10ander | 2012-07-28