A
Aquarius
Hi,
I am having trouble filling a Word table with (predefined) texts, using
VBA.
Word XP
My table is contained in a Bookmark.
On the basis of a language-switch I want to fill the table with either
English, Dutch, German etc. predefined texts.
Plus with some info I have read from the Word doc (Title, number of
pages, etc.).
I use two (Private) Subs:
* langFillRapStat and
* FillTable
Both take a input-variable (aTable as Table)
Strange thing is that (at execution) WordVBA throws a 'run-time err 13:
Type mismatch' at me,
because of langFillRapStat; whereas it does not complain about
FillTable.
Sniplet of code is below.
Any ideas, help is appreciated.
Regards,
Aquarius
Public Sub theCallingRoutine(bLangHasChanged As Boolean)
sBookmark="myTable"
With ActiveDocument.Bookmarks(sBookmark).Range
Set tblRapStat = .Tables(1)
If bLangHasChanged Then
'fill table with language-dependant fixed texts
langFillRapStat tblRapStat
End If
'fill tabel with variable texts
FillTable tblRapStat
Set tblRapStat = Nothing
End With 'ActiveDocument.Bookmarks(sBookmark).Range
<more code here>
End Sub 'theCallingRoutine
Private Sub langFillRapStat(aTable As Table)
'Fills the DocStatus-table with fixed texts
<my code here>
End Sub 'langFillRapStat
Public Sub FillTable(aTable As Table)
<my code here>
End Sub 'FillTable
I am having trouble filling a Word table with (predefined) texts, using
VBA.
Word XP
My table is contained in a Bookmark.
On the basis of a language-switch I want to fill the table with either
English, Dutch, German etc. predefined texts.
Plus with some info I have read from the Word doc (Title, number of
pages, etc.).
I use two (Private) Subs:
* langFillRapStat and
* FillTable
Both take a input-variable (aTable as Table)
Strange thing is that (at execution) WordVBA throws a 'run-time err 13:
Type mismatch' at me,
because of langFillRapStat; whereas it does not complain about
FillTable.
Sniplet of code is below.
Any ideas, help is appreciated.
Regards,
Aquarius
Public Sub theCallingRoutine(bLangHasChanged As Boolean)
sBookmark="myTable"
With ActiveDocument.Bookmarks(sBookmark).Range
Set tblRapStat = .Tables(1)
If bLangHasChanged Then
'fill table with language-dependant fixed texts
langFillRapStat tblRapStat
End If
'fill tabel with variable texts
FillTable tblRapStat
Set tblRapStat = Nothing
End With 'ActiveDocument.Bookmarks(sBookmark).Range
<more code here>
End Sub 'theCallingRoutine
Private Sub langFillRapStat(aTable As Table)
'Fills the DocStatus-table with fixed texts
<my code here>
End Sub 'langFillRapStat
Public Sub FillTable(aTable As Table)
<my code here>
End Sub 'FillTable