1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| Sub Main()
'
' Nécessite de référencer Microsoft Word xx.0 Object Library
'
' Déclaration
Dim oWrd As Word.Application ' Application Word
Dim oDoc As Word.Document ' Document Word traité
Dim oList As ListObject ' Tableau structuré
' Affectation
Set oWrd = New Word.Application
Set oList = Range("t_Data").ListObject
' Ouverture du nouveau document
Set oDoc = oWrd.Documents.Add
' Invoque la procédure
CopyTableToWord oDoc, oList
' Affiche le document
With oWrd
.Visible = True: .Activate
End With
' Fin
Set oWrd = Nothing: Set oDoc = Nothing
End Sub |
Partager