1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| Sub Export_Vers_Word()
Dim wd2003 As Object
Set wd2003 = CreateObject("word.application")
wd2003.Visible = True
AppActivate wd2003.Name
wd2003.Documents.Open Filename:="D:\toto.doc"
wd2003.Selection.Goto what:=wdGoToBookmark, Name:="Début" 'indique la localisation du curseur dans le fichier Wd sur le signet Début, prévoir un tableau d'une ligne dans word, contenant le nombre de colonnes qu'il faut
For i = 1 To 50
For j=1 to 50
wd2003.Selection.TypeText Tableau(j,i)' à adapter
wd2003.Selection.MoveRight Unit:=wdCell 'insertion d'une tabulation
Next
wd2003.Selection.InsertRowsBelow 1 'insertion d'une ligne
Next
wd2003.ActiveDocument.Save
Set wd2003 = Nothing
End Sub |
Partager