bSaveSuccess = OfficeDocument.store(xMSF, xTextDocument, sPath, "writer8_template", false, "Template could not be saved to " + sPath);
if (bSaveSuccess) {
saveConfiguration();
XInteractionHandler xIH = (XInteractionHandler) UnoRuntime.queryInterface(XInteractionHandler.class, xMSF.createInstance("com.sun.star.comp.uui.UUIInteractionHandler"));
PropertyValue loadValues[] = new PropertyValue[4];
loadValues[0] = new PropertyValue();
loadValues[0].Name = "AsTemplate";
loadValues[1] = new PropertyValue();
loadValues[1].Name = "MacroExecutionMode";
loadValues[1].Value = new Short (MacroExecMode.ALWAYS_EXECUTE);
loadValues[2] = new PropertyValue();
loadValues[2].Name = "UpdateDocMode";
loadValues[2].Value = new Short (com.sun.star.document.UpdateDocMode.FULL_UPDATE);
loadValues[3] = new PropertyValue();
loadValues[3].Name = "InteractionHandler";
loadValues[3].Value = xIH;
if (bEditTemplate) {
loadValues[0].Value = Boolean.FALSE;