Erwin's StarOffice Tango
Erwin Tenhumberg's Insights into Open Source and Dancing
... or why Open Competition matters

20050417 Sonntag April 17, 2005

Just switch! - Doing useful things with StarOffice 8's BeanShell support
I just played a bit more with StarOffice 8's BeanShell support. When I thought about something useful to implement I remembered that at one of my former employers we had some document templates for faxes that asked via a dialog for the recipient's address when a new document was created.

The following screenshot shows the dialog that pops up when the document is opened:



... the same dialog with data filled in:



... and the result/output:



For my little exercise I picked the "Highlight" BeanShall example and merged some code from the "HelloWorld" sample into it. Then I added some code from the Developer's Guide in order to jump to a Bookmark. The following screenshot shows the bookmark code:



I also had to create my own dialog. One can get to the dialog editor via "Tools - Macros - Organize Dialogs ...":



As you can see, I created one dialog:



In order to auto-start the BeanShell macro I had to do the following steps. First, I went to "Tools - Customize ...":



In the "Customize" dialog I picked the "Events" tab, selected the "Open Document" event and clicked on the "Assign Macro" button:



In the "Macro Selector" dialog I picked my address macro.



The BeanShell editor could be more comfortable, but I find it pretty cool to write macros using Java technology.
( Apr 17 2005, 03:33:42 PM CEST ) Permalink


Kommentare:

Senden Sie einen Kommentar:

Kommentare sind ausgeschaltet.

Archive
Links
Referenzierte URLs