Bonsoir à tous,

Je cherche à l aide d'une boucle for a copier un tableau ou liste dans un fichier word contenant un tableau.
La boucle ne fonctionne pas , elle inscrit toutes les itérations du tableau dans chaque cellule..Au lieu d'un itération une cellule..
Voici mon code...
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
 object missing = System.Reflection.Missing.Value;
            object ReadOnly = false;
            Word.Document doc = wordApp.Documents.Open(@"C:\test\test.docx", ref missing, ref ReadOnly, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing);
            wordApp.Visible = true;
 
            string[] textes = new string[6];
            textes[0] = "a"; textes[1] = "b"; textes[2] = "c"; textes[3] = "d"; textes[4] = "e"; textes[5] = "f";
 
            for (int i = 0; i < textes.Length; i++)
            {
 
                for (int row = 2; row <= doc.Tables[1].Rows.Count; row++)
                {
                    var cell = doc.Tables[1].Cell(row, 1);
                    cell.Range.Text = (textes[i]).ToString();
                }
 
            }
Merci pour votre aide et explication si possible.
Greg