Code is taken from a mail from Darragh Sherwin on dev@api.openoffice.org
# A wrapper function to wrap around OpenOffice's
# Dispatch API.
# islot is a Slot ID ( aka Command Name )
# For all Slot IDs see
# {%external http://framework.openoffice.org/servlets/ProjectDocumentList?folderID=72&expandFolder=72&folderID=71}
def executeSlot( ctx, controller, islot ):
dispatchHelper = ctx.ServiceManager.createInstanceWithContext( "com.sun.star.frame.DispatchHelper", ctx )
frame = controller.getFrame()
dispatchHelper.executeDispatch( frame, islot, "", 0, () )