Hi all, I have the follwing problem.
I have embedded Word in an eclipse plugin.
The document contains a table. I am processing its rows and get them in the follwing methd
/**
* Returns the row in the table with the given index
* @param tableVar - table variant
* @param rowIndex - row index
* @return rowVariant - row Variant
* @throws OleException
*/
public static Variant getRow(Variant tableVar, int rowIndex) throws OleException {
OleAutomation tableAuto = tableAuto = tableVar.getAutomation();
OleUtils.printAutomation(tableAuto);
Variant rowsVar = null;
while (rowsVar == null){
rowsVar = tableAuto.getProperty(101/*Rows*/);
}
OleAutomation rowsAuto = rowsVar.getAutomation();
Variant rowVar = rowsAuto.invoke(0/*Item*/, new Variant[]{new Variant(rowIndex)});
return rowVar;
}
Sometimes I get them sometimes the Word application crashes.
Then I get rowsVar as null, though it had a Dispatch in the preceding calls.
The rowIndex when it crashes is an arbitrary value - it is not the same every time.
Has someone any ideas what may be the problem?
[Updated on: Tue, 26 March 2013 17:56]
Report message to a moderator