らんだむな記憶

blogというものを体験してみようか!的なー

OpenOfficeのドキュメント内のテキストを表示

インストール済みフォントの列挙 - らんだむな記憶OpenOffice 版を試してみるもサンプルが少なすぎて全然分からない・・・

var stdout = WScript.StdOut;

var doc = desktop.loadComponentFromURL("file:///D:/tmp/sample.odt", "_blank", 0, []);

var text = doc.getText();
var enumeration = text.createEnumeration();

while (enumeration.hasMoreElements()) {
    var text_element = enumeration.nextElement();
    stdout.WriteLine(text_element.string);
}

JScript で頑張るのは辛すぎるので python マクロを使っていこう・・・