描述:
问题是这样的,我已经得到了一个range,range里有张表,我用table=tables.Item(1);得到表,请问我怎么样得到这张表里的行数和列数并把它付给一个int变量呢?
解决方案1:
table.GetRows();
table.GetCount();
/*
for(int kIndex=1;kIndex<=(int)m_WordTables.GetCount();kIndex++)
{
m_WordTable=m_WordTables.Item(kIndex);
m_WordColumns=m_WordTable.GetColumns();
for(int mIndex=1;mIndex<=(int)m_WordTable.GetRows();mIndex++)
{
for(int nIndex=1;nIndex<=(int)m_WordColumns.GetCount();nIndex++)
{
m_WordCell=m_WordTable.Cell(mIndex,nIndex);
m_WordRange=m_WordCell.GetRange();
strDataArray.Format("%s%s\n",strDataArray,m_WordRange.GetText());
m_WordRange.ReleaseDispatch();
m_WordCell.ReleaseDispatch();
}
}
m_WordColumns.ReleaseDispatch();
m_WordTable.ReleaseDispatch();
}
*/
看到了:
m_WordTable.GetRows();
m_WordColumns.GetCount();