whitakaster
MIS
I am new to VBA, and was passed some code to start looking through so we can create a Word mail merge invoice with a details section. This partial code was pulled straight out of a book, so I don't know why this isn't compiling properly. Errata what? I am using Word 2002.
The first 5 lines are throwing the error "user-defined type not defined".
Function CreateTableFromRecordset( _
rngAny As Word.Range, _
rstAny As ADODB.Recordset, _
Optional fIncludeFieldNames As Boolean = False) _
As Word.Table
Dim objTable As Word.Table
Dim fldAny As ADODB.Field
Dim varData As Variant
Dim strBookmark As String
Dim cField As Long
Appreciate the advice!
Chad
The first 5 lines are throwing the error "user-defined type not defined".
Function CreateTableFromRecordset( _
rngAny As Word.Range, _
rstAny As ADODB.Recordset, _
Optional fIncludeFieldNames As Boolean = False) _
As Word.Table
Dim objTable As Word.Table
Dim fldAny As ADODB.Field
Dim varData As Variant
Dim strBookmark As String
Dim cField As Long
Appreciate the advice!
Chad