Ik ben nog altijd aan het uitvogelen hoe ik dit voor elkaar krijg. Dacht miss dat ik een macro kan opnemen in WORD en deze gebruiken, maar dat bleek niet de oplossing te zijn. Het moet gewoon een losse tabel zijn waarbij ik zelf aangeef wat erin moet komen.
Code:
Sub CreateNewWordDoc2()
Dim wrdApp As Word.Application
Dim wrdDoc As Word.Document
Set wrdApp = CreateObject("Word.Application")
wrdApp.Visible = True
Set wrdDoc = wrdApp.Documents.Add ' create a new document
' or
'Set wrdDoc = wrdApp.Documents.Open("C:\Foldername\Filename.doc")
' open an existing document
' example word operations
With wrdDoc
.Tables.Add Range:=Selections.Range, NumRows:=2, NumColumns:=3 _ ,DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:= _
wdAutoFitFixed
With Selection.Tables(1)
If .Style <> "Tabelraster" Then
.Style = "Tabelraster"
End If
.ApplyStyleHeadingRows = True
.ApplyStyleLastRow = False
.ApplyStyleFirstColumn = True
.ApplyStyleLastColumn = False
.ApplyStyleRowBands = True
.ApplyStyleColumnBands = False
End With
Selection.TypeText Text:="hfdl"
Selection.MoveRight Unit:=wdCell
Selection.MoveRight Unit:=wdCell
Selection.MoveRight Unit:=wdCell
Selection.MoveRight Unit:=wdCell
Selection.TypeText Text:="jk"
Selection.MoveRight Unit:=wdCell
Selection.TypeText Text:="k"
End With
Set wrdDoc = Nothing
Set wrdApp = Nothing
End Sub