Hi all,

As from subject, I cannot manage to add a keyboard shortcut (in Writer) via 
StarBasic code.
Below my testing code
What am I missing?

Thank you for any help 
Paolo Mantovani


REM  *****  BASIC  *****

Sub Test

' Retrieve the module configuration manager from central module configuration 
manager supplier
oModuleCfgMgrSupplier = _
CreateUnoService("com.sun.star.ui.ModuleUIConfigurationManagerSupplier")

' Retrieve the module configuration manager with module identifier
' See com.sun.star.frame.ModuleManager for more information
oModuleCfgMgr = 
oModuleCfgMgrSupplier.getUIConfigurationManager("com.sun.star.text.TextDocument")
oShortCutMgr = oModuleCfgMgr.getShortCutManager

' prepare parameters
sCommand = 
"vnd.sun.star.script:Vocabulary.Main.Main?language=Basic&location=application"

Dim aKeyEvent As New com.sun.star.awt.KeyEvent
With aKeyEvent
  .Modifiers = com.sun.star.awt.KeyModifier.MOD1 'CTRL key
  .KeyCode = com.sun.star.awt.Key.T 
End With

'add the shortcut
oShortCutMgr.setKeyEvent( aKeyEvent, sCommand )

End Sub

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

Reply via email to