我确实将整个字符串 [4273,11] 复制到 Word 中,但是每次循环和插入每个单元格都需要很长时间。我想要做的是将整个字符串 [4273,11] 直接复制到MS Word 表中。如果还有一种方法可以将 Excel 工作表的内容复制到 MS Word,我将不胜感激,因为它将以任何方式解决问题。
public void WriteContent(string[,] array, Word.Table oDoc)
{
// This is where I fill the Excel worksheet with the string [4273,11] array
Range range = (Range)m_worksheet.Cells[1, 1];
range = range.get_Resize(4273, 11);
// Assign the 2-d array to the Excel Range
range.set_Value(Microsoft.Office.Interop.Excel.XlRangeValueDataType.xlRangeValueDefault, array);
//This is Where I want to Paste the Excel "range" into the word document
}