Code:
Function GanzeTabelleTransferieren(Array, ende As Integer)
'Dimensionierung der Variablen
Dim objWordApp As Object
Dim objWordDok As Object
'Festlegen der Vorgabewerte
Set objWordApp = CreateObject("Word.application")
'Starten der Word-Instanz und eine neues Dokument öffnen
objWordApp.Visible = True
Set objWordDok = objWordApp.Documents.Open("C:\Indexnachweis.doc")
'Anschrift in das Dokument eintragen
For i = 0 To ende
With objWordApp.Selection
.TypeText Text:="A"
.MoveRight Unit:=wdCell
.TypeText Text:="27.10.02"
.MoveRight Unit:=wdCell
.TypeText Text:="is"
.MoveRight Unit:=wdCell
.TypeText Text:="test"
.MoveRight Unit:=wdCell
End With
Next
End Function
Sub test()
GanzeTabelleTransferieren(Array,10)
End Sub