N
nathan
Hi, I'm trying to do a mail merge using C#. I copied this code directly
from the MSDN site, but I keep getting a compile error. The error is:
Cannot apply indexing with [] to an expression of type 'Word.Tables'
I have Word 2003 Basic Installed. My partner has Word 2003 Professional
installed, and he has no problem compiling the same code on his machine.
The code that's creating the build error is:
document.Tables[1].Rows[row].Cells[i+1].Range.InsertBefore(values.ToString());
oDataDoc.Tables[1].Rows[oDataDoc.Tables[1].Rows.Count].Delete();
(the inner oDataDoc.Tables[1] causes an error here, not the outer one)
oDataDoc.Tables[0].Rows.Add(ref _MISSING);
(the ODataDoc.Tables[0] is causing the error here)
I have a couple more, of these same errors, but you get the idea. The weird
thing is that the exact same code compiles with no problems on a different
machine with the Word Professional 2003 installed, while I have the Word
Basic 2003. Thanks for any help you can offer, I really need to get this
done soon.
Nathan
from the MSDN site, but I keep getting a compile error. The error is:
Cannot apply indexing with [] to an expression of type 'Word.Tables'
I have Word 2003 Basic Installed. My partner has Word 2003 Professional
installed, and he has no problem compiling the same code on his machine.
The code that's creating the build error is:
document.Tables[1].Rows[row].Cells[i+1].Range.InsertBefore(values.ToString());
oDataDoc.Tables[1].Rows[oDataDoc.Tables[1].Rows.Count].Delete();
(the inner oDataDoc.Tables[1] causes an error here, not the outer one)
oDataDoc.Tables[0].Rows.Add(ref _MISSING);
(the ODataDoc.Tables[0] is causing the error here)
I have a couple more, of these same errors, but you get the idea. The weird
thing is that the exact same code compiles with no problems on a different
machine with the Word Professional 2003 installed, while I have the Word
Basic 2003. Thanks for any help you can offer, I really need to get this
done soon.
Nathan