Bonjour!
Voila dans un code que j'ai trouvé sur http://www.developpez.net/forums/viewtopic.php?t=415780, on parle de data
mais d'ou est ce que ça vient? je ne comprend pas
Code:
public class TestOOo
{
public static void main(String[] args)
{
System.out.println("******** DEBUT DU TRAITEMENT ********");
long start = System.currentTimeMillis();
try
{
// get the remote office component context
long st = System.currentTimeMillis();
OOoUtils OOo = new OOoUtils();
XMultiComponentFactory xMCF = OOo.useConnection();
XDesktop xDesktop = OOo.getXDesktop();
XComponentLoader xComponentLoader =
(XComponentLoader)UnoRuntime.queryInterface(XComponentLoader.class, xDesktop);
System.out.println("Loading : "
+ (System.currentTimeMillis() - st) + " ms");
// Ouvrir un doc existant
PropertyValue[] prop = new PropertyValue[1];
prop[0] = new PropertyValue();
prop[0].Name = "Hidden";
prop[0].Value = Boolean.TRUE;
st = System.currentTimeMillis();
XComponent xComp = xComponentLoader.loadComponentFromURL("file:///h:/TEST/Word/test1.doc", "_blank", 0, prop);
System.out.println("XComponent : "
+ (System.currentTimeMillis() - st) + " ms");
// Charger l'objet XTextDocument
st = System.currentTimeMillis();
XTextDocument xTextDoc = (XTextDocument)UnoRuntime.queryInterface(XTextDocument.class, xComp);
System.out.println("\nXTextDocument (" +xTextDoc.getURL()+ ") :"+
+ (System.currentTimeMillis() - st) + " ms");
st = System.currentTimeMillis();
File data = new File("H:/TEST/Word/test1.data");
juste à la dernière ligne
ce code utilise openOffice
merci de vos reponses