private XTextDocument reloadFrom(String sFilter, String sExtension) throws com.sun.star.io.IOException, com.sun.star.uno.Exception { String sFileUrl = util.utils.getOfficeTemp(m_xMsf) + "/Bookmarktest." + sExtension; try { PropertyValue[] aStoreProperties = new PropertyValue[2]; aStoreProperties[0] = new PropertyValue(); aStoreProperties[1] = new PropertyValue(); aStoreProperties[0].Name = "Override"; aStoreProperties[0].Value = true; aStoreProperties[1].Name = "FilterName"; aStoreProperties[1].Value = sFilter; XStorable xStorable = UnoRuntime.queryInterface(XStorable.class, m_xDoc); xStorable.storeToURL(sFileUrl, aStoreProperties); return util.WriterTools.loadTextDoc(m_xMsf, sFileUrl); } finally { if (util.utils.fileExists(m_xMsf, sFileUrl)) util.utils.deleteFile(m_xMsf, sFileUrl); } }