Hi, people.
I’m developing an extension using java works for Open Office Writer, and in some point I need to get the URL for the file that is currently opened in open office writer.
Any idea in how to get the path for the writer.odt files ?
This is what I get so far but it dose not work !
desktop = xmcf.createInstanceWithContext(“com.sun.star.frame.Desktop”, m_xContext);
xDesktop = (XDesktop) UnoRuntime.queryInterface(com.sun.star.frame.XDesktop.class, desktop);
xDoc = xDesktop.getCurrentComponent();
xTextDocument = (XTextDocument) UnoRuntime.queryInterface(com.sun.star.text.XTextDocument.class, xDoc);
String dataDir = xTextDocument.getURL()+ File.separator;
//ExStart
//ExId:ExtractContentBasedOnStyles_Main
//ExSummary:Run queries and display results.
// Open the document.
Document doc = new Document(dataDir+ “Test.odt”);