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
|
Sub ImprimerDeTableau()
Dim oTbl As Table
Dim oCl As cell
Dim i As Integer, j As Integer
Dim stPage As String
i = 1
j = ActiveDocument.Tables(1).Rows.Count
Set oTbl = ActiveDocument.Tables(1)
For i = 1 To j
Debug.Print oTbl.cell(i, 1).Range.Text
If UCase(Left(oTbl.cell(i, 1).Range.Text, 1)) = "Y" Then
stPage = stPage & Left(oTbl.cell(i, 2).Range.Text, (Len(oTbl.cell(i, 2).Range.Text) - 2)) & ","
End If
Next i
ActiveDocument.PrintOut Pages:=stPage
Debug.Print stPage
End Sub |
Partager