Bonjour,

Je cherche à transformer un document au format word (.doc) en un fichier texte (.txt). Pour se faire j'utilise jacob. L'exportation fonctionne, cependant mon document contient des checkbox (coché ou non) que jacob n'arrive pas à transposer en texte (0 ou 1) comme le fait word lors de l'enregistrement en format texte.

Auriez vous une idée me permettant de récupérer la valeur de la checkbox sous un format (boolean ou bien 0/1).

Merci d'avance.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
private void docToTxt(final String _fileNameInput, final String _fileNameOutput) {
       ActiveXComponent oWord = new ActiveXComponent("Word.Application");
       Dispatch oDocuments = oWord.getProperty("Documents").toDispatch();
       Dispatch oDocument = Dispatch.call(oDocuments, "Open", _fileNameInput).toDispatch();
       // 3 = text with line breaks
       Dispatch.call(oDocument, "SaveAs", _fileNameOutput, new Variant(3));
       oWord.invoke("Quit", new Variant[0]);
}