我用vc在word里画了一张表格,填写完数据保存。这时候如果我想要从表格中把数据读出来该怎么做呢??
下面是我的代码:
_Document oActiveDoc;
oActiveDoc = m_App.GetActiveDocument();
Tables oTables;
oTables=oActiveDoc.GetTables();
Table oTable;
oTable.AttachDispatch(oTables.Item(1));
LPDISPATCH range=oTable.Cell((long)1,(long)1);
Table类里面的cell()方法是LPDISPATCH类型的,该怎样提取数据呢?郁闷好几天了...感谢帮忙
下面是我的代码:
_Document oActiveDoc;
oActiveDoc = m_App.GetActiveDocument();
Tables oTables;
oTables=oActiveDoc.GetTables();
Table oTable;
oTable.AttachDispatch(oTables.Item(1));
LPDISPATCH range=oTable.Cell((long)1,(long)1);
Table类里面的cell()方法是LPDISPATCH类型的,该怎样提取数据呢?郁闷好几天了...感谢帮忙
Variable valDisp(range);
CString str = valDisp.GetValue()
但是能不能直接在我上面的程序中修改,你说的Variable属性我不太清楚是什么啊
感谢zgl7903,非常感谢,问题解决