while (xEnum.hasMoreElements()) {
Object oTextField = xEnum.nextElement();
XServiceInfo xSI = (XServiceInfo) UnoRuntime.queryInterface(XServiceInfo.class, oTextField);
if (xSI.supportsService("com.sun.star.text.TextField.ExtendedUser")) {
XUpdatable xUp = (XUpdatable) UnoRuntime.queryInterface(XUpdatable.class, oTextField);
xUp.update();
}
if (xSI.supportsService("com.sun.star.text.TextField.User")) {
XUpdatable xUp = (XUpdatable) UnoRuntime.queryInterface(XUpdatable.class, oTextField);
xUp.update();
}
}
} catch (Exception e) {
e.printStackTrace();
}