My Technical Notes

Tuesday, 10 February 2015

OpenOffice: Adding a Keyboard shortcut for a specific Shape

First find out what internal command is being used by OpenOffice using List of Internal OO Commands.

Add a macro for this command, and then finally assign a keyboard shortcut for this macro. Below is a macro which inserts a 'Flowchart: Alternate Process' shape:

sub InsertAltProcess
   dim document as object
   dim dispatcher as object

   document   = ThisComponent.CurrentController.Frame
   dispatcher = createUnoService("")
   dispatcher.executeDispatch(document, ".uno:FlowChartShapes.flowchart-alternate-process", "", 0, Array())
end sub

No comments: