L
LBowman
I have a dataview with a varying number of records in it. I want to create a
Word table and add the data in my dataview to the table.
Currently, I have created the word table and loop through each record in the
dataview and do the following for each:
wdMMTable.Rows.Add()
iwdRow = iwdRow + 1
wdMMTable.Cell(iwdRow, 1).Range.InsertAfter(dvMailMerge.Item(iRow).Item(0))
wdMMTable.Cell(iwdRow, 2).Range.InsertAfter(dvMailMerge.Item(iRow).Item(1))
wdMMTable.Cell(iwdRow, 3).Range.InsertAfter(dvMailMerge.Item(iRow).Item(2))
(I actually have 18 columns, not just 3)
This is extremely slow for a large number of records and above a certain
number either locks up or crashes the machine.
I have read that the fastest way is to write the data to a string and then
create the table from the string. Is there another, more direct way to add
the records from a dataview to a word table. I am using VB.NET 2003 and MS
Word 2000.
Thank you,
Laure Bowman
Word table and add the data in my dataview to the table.
Currently, I have created the word table and loop through each record in the
dataview and do the following for each:
wdMMTable.Rows.Add()
iwdRow = iwdRow + 1
wdMMTable.Cell(iwdRow, 1).Range.InsertAfter(dvMailMerge.Item(iRow).Item(0))
wdMMTable.Cell(iwdRow, 2).Range.InsertAfter(dvMailMerge.Item(iRow).Item(1))
wdMMTable.Cell(iwdRow, 3).Range.InsertAfter(dvMailMerge.Item(iRow).Item(2))
(I actually have 18 columns, not just 3)
This is extremely slow for a large number of records and above a certain
number either locks up or crashes the machine.
I have read that the fastest way is to write the data to a string and then
create the table from the string. Is there another, more direct way to add
the records from a dataview to a word table. I am using VB.NET 2003 and MS
Word 2000.
Thank you,
Laure Bowman