I am using VSTO to fill data into a table in a Microsoft Word 2007 template. The amount of data varies and filling many pages (+50) takes a lot of time.
The code I use to create a table:
Word.Table table = doc.Tables.Add(tablePosition,
numberOfRows,
8,
ref System.Reflection.Missing.Value,
ref System.Reflection.Missing.Value);
I suspect that the time consumption is due to the communication between Visual Studio (C#) and Word each time I insert data into a cell. If this is the case, it might be faster to create the table in C# and afterwards insert it into Word.
The Microsot.Office.Interop.Word.Table is an abstract class - thus I cannot do this
Word.Table table = new Word.Table();
which would have been handy.
Are there other possibilities when just using VSTO?
Regards, Casper