How can I dispatch a macro Url from my Java Add-on?

I'd like to dispatch the following function in the Tools/ModuleControles Library:

StoreDocument(oDocument as Object, FilterNames() as String, DefaultName as String, DisplayDirectory as String, Optional iAddProcedure as Integer)

I'd like to call this function from my add-on. It would be best if I could call this function from my Addons.xcu but this leads to a crash since I don't know how to set the oDocument parameter in the xcu file. Is there any other chance to call the macro? I can catch the dispatch for the corresponding button but don't know how to go any further..

Thanks

public void dispatch(URL arg0, PropertyValue[] arg1) {
       if (arg0.Protocol.compareTo("org.openoffice.addon.MyAddon:") == 0) {
           if (arg0.Path.compareTo("FuncExport") == 0) {
               try {
                   Iterator iterOn = frames.iterator();
                   while (iterOn.hasNext()) {
                       FrameInfo actFrameInfo = (FrameInfo) iterOn.next();
                       if (actFrameInfo.getXComp() == ElementController
                               .getXComponent()) {
                           convertElml = actFrameInfo.getXmlConverter();
                           break;
                       }
                   }
// NOW CALL THE MACRO

               } catch (java.lang.Exception e) {
                   e.printStackTrace();
               }
           }
       }
   }

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to