读书人

操作Word里的报表提示 集合所要求的

发布时间: 2011-12-25 23:21:20 作者: rapoo

操作Word里的表格,提示 集合所要求的成员不存在?
为什么?
提供部分代码:
object oRead = false;

oWordDoc = (Word.Document)oWordApp.Documents.Open(ref m_filePath, ref oMissing, ref oRead, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing);

for (int tablePos = 0; tablePos < oWordDoc.Tables.Count; tablePos++)
{
     Word.Table newTable = oWordDoc.Tables[tablePos];//执行到此处就提示"集合所要求的成员不存在"
}
查了N多资料,这样写没有错误呀.
望高人出手.


[解决办法]
关注中……
[解决办法]
oWordDoc.Tables[tablePos]
我记得好象是从 1 开始计数的

读书人网 >C#

热点推荐