ActionTriggerContainer.createInstance ("com.sun.star.ui.ActionTrigger") creates an ActionTrigger with no methods to change the property values. DBG_Properties returns the following: SbxOBJECT SourceWindow SbxOBJECT ExecutePosition SbxOBJECT ActionTriggerContainer SbxOBJECT Selection SbxSTRING Dbg_SupportedInterfaces SbxSTRING Dbg_Properties SbxSTRING Dbg_Methods DBG_Methods returns the following: No methods found DBG_SupportedInterfaces returns the following: No methods found Following code will crash: Function MenuOverride_notifyContextMenuExecute(oActionTrigger) dim oNewMenuItem oNewMenuItem = oActionTrigger.ActionTriggerContainer.createInstance ("com.sun.star.ui.ActionTrigger") 'No property set methods available, following code will crash oNewMenuItem.setPropertyValue("Text", "New Menu Item") oNewMenuItem.setPropertyValue("CommandURL", "macro:///SomeMacro") oActionTrigger.ActionTriggerContainer.insertByIndex (0, oNewMenuItem) MenuOverride_notifyContextMenuExecute = com.sun.star.ui.ContextMenuInterceptorAction.EXECUTE_MODIFIED End Function
Most of the interfaces are missing on both ActionTrigger and ActionTriggerContainer. This has been fixed in Apache OpenOffice: https://issues.apache.org/ooo/show_bug.cgi?id=67068 -- Services ActionTrigger and ActionTriggerContainer don't implement XTypeProvider
Fixed in LibreOffice 4