c++builder在用ole导出报表到word(用的妖哥的方法)
c++builder在用ole导出表格到word(用的妖哥的方法)
为什么我在表格后面加内容的时候,总是加到了表格的第一行第一列呢?
------解决方案--------------------
需要在表格后面填充内容时,需要定位一下光标,可以模拟按一下ctrl + end键,录个宏自己翻译一下就知道了。
为什么我在表格后面加内容的时候,总是加到了表格的第一行第一列呢?
//插入表格
vWordApp.OlePropertyGet("ActiveDocument").OlePropertyGet("Tables")
.OleProcedure("Add",vSelect.OlePropertyGet("Range"),
nRowCount, // 行数
nColCount, // 列数
1, // DefaultTableBehavior:=wdWord9TableBehavior
0);
// 操作这个表格
vTable = vWordApp.OlePropertyGet("ActiveDocument")
.OleFunction("Range").OlePropertyGet("Tables").OleFunction("Item", 1);
....
C++Builder
Word
------解决方案--------------------
需要在表格后面填充内容时,需要定位一下光标,可以模拟按一下ctrl + end键,录个宏自己翻译一下就知道了。