I'm using the excel2word code that you created awhile back to import some excel ranges into a word document. The import worked great until I found I had to process several spreads and import them, then the tables all merge together.
Simple explanation: I create spread1, grab range1, move to bookmark1
write line the company name and then insert the spread range table.
Grab bookmark2, move to bookmark 2 and insert range.
Next create spread 2 and repeat the above steps
Instead of getting
Company1
Table1
Company2
Table2
I end up with
Company1
Company2
Table1
Table 2
with the tables merged into a single table. They need to be unique tables with spacing and descriptive information between them.
Here is a code sample, the undeclared variables are passed into the function.
The application is VB.Net
Thanks
Donna
Dim builder As DocumentBuilder = New DocumentBuilder(doc)
builder.MoveToBookmark(bookmark, False, False)
Dim sectionIndex As Integer = doc.Sections.IndexOf(builder.CurrentSection)
'Get array of Word tables, every table in this array represents a part of Excel worksheet.
Dim partsArray As ArrayList = GetRangePartsArray(rangename, worksheet, doc, sectionIndex)
'Insert all tables into the Word document
builder.MoveToBookmark(bookmark, False, False)
builder.Writeln(String.Empty)
builder.Writeln("Company name")
For Each table As Table In partsArray
'Insert table
builder.CurrentSection.Body.AppendChild(table)
Exit For
Next