XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class,
atw);
XAccessible xRoot = at.getAccessibleObject(xWindow);
XAccessibleContext ARoot = at.getAccessibleObjectForRole(xRoot,
AccessibleRole.MENU_BAR);
XAccessibleSelection sel = (XAccessibleSelection) UnoRuntime.queryInterface(
XAccessibleSelection.class, ARoot);
for (int k = 0; k < indexes.length; k++) {
try {
sel.selectAccessibleChild(indexes[k]);
shortWait();
ARoot = ARoot.getAccessibleChild(indexes[k])
.getAccessibleContext();
sel = (XAccessibleSelection) UnoRuntime.queryInterface(
XAccessibleSelection.class, ARoot);
} catch (com.sun.star.lang.IndexOutOfBoundsException e) {
}