XDocumentIndexMark xDIM = (XDocumentIndexMark)
UnoRuntime.queryInterface(XDocumentIndexMark.class, oDIM);
try {
xDIM.attach(oText);
//xDIM.setMarkEntry("SwXDocumentIndexMark");
} catch( com.sun.star.lang.IllegalArgumentException e ) {
log.println("Error: " + e);
e.printStackTrace(log);
throw new StatusException("Couldn't attach IndexMark", e);