V
Vinix
There are 3 table in the doc file. They are just pasted from another file.
Now I want to change the text in the first cell of each row, but when I want
to get the text, I got COMExceptrion from "CurrRow.Cells[0]" which says
member needed in the collection is not existed (something like that, I
translated the message from Chinese).
Below is my code snippet in C# that cause the exception:
using Word = Microsoft.Office.Interop.Word;
...(Code omitted)...
foreach (Word.Table CurrTable in docNewFile.Tables)
{
foreach (Word.Row CurrRow in CurrTable.Rows)
{
string OriginalText = CurrRow.Cells[0].Range.Text;
CurrRow.Cells[0].Range.Text = "HeaderString" + OriginalText;
}
}
Is there anything wrong? I'm using VS2005 C#.
Now I want to change the text in the first cell of each row, but when I want
to get the text, I got COMExceptrion from "CurrRow.Cells[0]" which says
member needed in the collection is not existed (something like that, I
translated the message from Chinese).
Below is my code snippet in C# that cause the exception:
using Word = Microsoft.Office.Interop.Word;
...(Code omitted)...
foreach (Word.Table CurrTable in docNewFile.Tables)
{
foreach (Word.Row CurrRow in CurrTable.Rows)
{
string OriginalText = CurrRow.Cells[0].Range.Text;
CurrRow.Cells[0].Range.Text = "HeaderString" + OriginalText;
}
}
Is there anything wrong? I'm using VS2005 C#.