1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| 'ajout du tableau des produits
Set oTbl = LeDocWord.Tables(1)
ligne = 40
oTbl.Rows.Last.Cells(1).Range.Text = Cells(ligne, 7)
oTbl.Rows.Last.Cells(2).Range.Text = Cells(ligne, 8)
oTbl.Rows.Last.Cells(3).Range.Text = Cells(ligne, 9)
oTbl.Rows.Last.Cells(4).Range.Text = Cells(ligne, 10)
ligne = ligne + 1
'ajout dans les balises
balisetableauprod = "<destignationprod>" & Cells(ligne, 7) & "</destignationprod><quantitéprod>" & Cells(ligne, 8) & "</quantitéprod><prixunitaireprod>" & Cells(ligne, 9) & "</prixunitaireprod><totalprod>" & Cells(ligne, 10) & "</totalprod>"
Do While Not IsEmpty(Cells(ligne, 7))
'ajout des infos pour chaque produit dans le tableau de la facture
oTbl.Rows.Add
oTbl.Rows.Last.Cells(1).Range.Text = Cells(ligne, 7)
oTbl.Rows.Last.Cells(2).Range.Text = Cells(ligne, 8)
oTbl.Rows.Last.Cells(3).Range.Text = Cells(ligne, 9)
oTbl.Rows.Last.Cells(4).Range.Text = Cells(ligne, 10)
'ajout dans les balises
balisetableauprod = balisetableauprod & "<destignationprod>" & Cells(ligne, 7) & "</destignationprod><quantitéprod>" & Cells(ligne, 8) & "</quantitéprod><prixunitaireprod>" & Cells(ligne, 9) & "</prixunitaireprod><totalprod>" & Cells(ligne, 10) & "</totalprod>"
ligne = ligne + 1
Loop
'inscription des balises du tableau dans la facture
With LeDocWord
.Bookmarks("tableprod").Range.Text = balisetableauprod
End With
Set oTbl = Nothing |
Partager