Testing using OpenOffice.org macros

You will now have to test the component using OpenOffice.org macros. There are two steps for this:

  1. Add the component to the package manager. In OpenOffice.org 2.0 open the package manager using the toolspackage manager menu item. Next select the My Packages category and click on the Add button. You just have to select the bin/ant/helloworld.uno.pkg file in your project and check that the package is activated.

  2. Writing and executing a basic macro call the sayHello() method.

Now you will create and execute a basic macro containing the code below. You should see a small window with the "Hello UNO world from Java" or whatever text you returned in your implementation.

Sub TestHelloworld
 helloworld = createUnoService("org.openoffice.helloworld.Helloworld")
 print helloworld.sayHello()
End Sub