General information
Category:
COM/DCOM and OLE Automation
That's not exactly the problem. On the fly I create a datasource in MS Word. After creating my datasource I edit my datasource. This action gives me an entry to a word-document containing 1 table including my header record.
The next step is expanding this table and fill all te cells with data.
oTable = oWord.Activedocument.Tables[1]
oRow = oTable.Rows[2] && The first row contains header information
SELECT myQuery
SCAN
FOR nField = 1 TO FCOUNT()
oRow.Cells[nField].Range.InsertAfter( EVAL( FIELDS( nField )))
ENDFOR
oRow = oTable.Rows.Add()
ENDSCAN
oRow.Delete()
This routine is very slow when I have to process 5000 records containing 21 fields. I need a solution to create in MS Word on the fly a datasource containing all my data.
The template used for the mailmerge is created by the user. I don't know the exact details of this letter.
Sander
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only