Bonjour Jean-Baptiste,
À l'occasion de cette demande d'amélioration :
https://bugs.documentfoundation.org/show_bug.cgi?id=101110
je me demande si on ne pourrait pas faire ça avec une macro.
Est-ce que des experts des macros LibreOffice ont une idée là-dessus ?
je ne suis pas un expert... cependant il existe en effet une possibilité d'accéder aux menus de LibO par macro.
J'ai écrit et j'utilise ce qui suit dans mes propres macros.
L'ensemble des options de menus est disponible dans le fichier
\share\config\soffice.cfg\modules\sglobal\menubar\menubar.xml du dossier d'installation.
On pourrait donc imaginer une extension qui ajouterait une option de menu et une liste déroulante pour choisir l'option à exécuter. Ce serait plus rudimentaire que ce que fait AutoCAD mais ça marcherait, je pense.
Ceci dit, je ne vois pas trop l'intérêt. Quand on utilise souvent la même option de menu, on a intérêt à y associer un raccourci clavier, s'il n'existe pas déjà.
8< ------------------------------------------------------------
Sub _UNOMenuCommand(ByRef pUnoCmd As String)
'runs any UNO menu command, in pUnoCmd.
'There is no control on the command passed.
'
'The menu commands are available in the menubar.xml file, found in
'LibreOffice install directory, subdir \share\config\soffice.cfg\modules\sglobal\menubar
Dim lo_Window As Variant
Dim lo_Dispatch As Object
Dim l_Args()
lo_Window = StarDesktop.CurrentFrame
lo_Dispatch = createUnoService(LOPRIM_SERV_DISPATCH)
lo_Dispatch.executeDispatch(lo_Window, ".uno:" & pUnoCmd, "", 0, l_Args())
End Sub 'UNOMenuCommand
Sub SetFullScreen()
'Sets the current window to full screen
'Note: LibO then displays the FullScreen toolbar.
_UNOMenuCommand("FullScreen")
End Sub 'SetFullScreen
Sub ShowPrinterDialog()
'Calls the LibO document printer dialog
_UNOMenuCommand("Print")
End Sub 'ShowPrinterDialog
Sub ShowPrintPreview()
'Calls the LibO print preview dialog
_UNOMenuCommand("PrintPreview")
End Sub 'ShowPrintPreview
Sub ShowDocumentProperties()
'Calls the LibO document properties dialog
_UNOMenuCommand("SetDocumentProperties")
End Sub 'ShowDocumentProperties
-------------------------------------------------------- >8
Amicalement,