Python (pyuno) "Hello World" Addon for OpenOffice
Feb 07, 2009, 01:34 (0 Talkback[s])
(Other stories by Mitch Frazier)
"As is the law, our first program when doing something new has
to be a "Hello World" program. The idea here is to add an option to
the OpenOffice menu which will insert "Hello World" into the first
cell of a spreadsheet. As a starting point for this example I used
an example from the pyuno udk site (the second "Hello World"
example on the page).
"The example there does essentially the same thing as the
example here except there it inserts "Hello World" into a Writer
(Word Processor) document rather than a spreadsheet. One would
assume that it would be a fairly easy conversion, and once I knew
the answer it was. The hard part was figuring out how to get the
"spreadsheet" object and then how to get a "cell" object from it.
And it wasn't so much hard as just time consuming trying to find
the right information in the documentation.
"After a few hours of searching and a few false starts I came
across the two needed interfaces: XSpreadsheetDocument and XCell.
These gave me what I needed to modify the example to work with a
spreadsheet:"
Complete Story
Related Stories: