[Solved] How to Add a menu to the calc menu bar, via macro

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
martius
Posts: 56
Joined: Sat Feb 05, 2011 9:41 pm
Location: São Paulo, Brasil

[Solved] How to Add a menu to the calc menu bar, via macro

Post by martius »

How to add a menu to the calc menu bar, via macro? Thanks
Last edited by floris v on Thu Oct 24, 2019 1:15 pm, edited 2 times in total.
Reason: Tagged as Solved, floris v, moderator
LibreOffice 6.2.8.2 (x64), Windows 10 Home
User avatar
Zizi64
Volunteer
Posts: 11353
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: How to Add a menu to the calc menu bar, via macro

Post by Zizi64 »

It is not enough to add your macros to the menu bar or to the toolbar manually? Do you want to do it dynamically? (Do you want often change it?)

If you want to do it on more than one PC, then it is better to withe your macros as an Extension. You can control the menu entries automatically by an extension - when you install it.
There are extension written in StarBasic. Just download them, unpack them, and you will able examine the code lists in side the extension. An .oxt extension is a .zip file really, but with different name of the three-letter file extension.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
martius
Posts: 56
Joined: Sat Feb 05, 2011 9:41 pm
Location: São Paulo, Brasil

Re: How to Add a menu to the calc menu bar, via macro

Post by martius »

Thank you for the suggestion about an extension. But, in my case, it would be much more simple if I could use a macro. I even know a macro to add a button to a toolbar, but I want to add a new menu, with sub-menus, to the menubar. I still hope that someone know how to do it via macro and can help me with some tips. Thanks anyway.
LibreOffice 6.2.8.2 (x64), Windows 10 Home
JeJe
Volunteer
Posts: 2764
Joined: Wed Mar 09, 2016 2:40 pm

Re: How to Add a menu to the calc menu bar, via macro

Post by JeJe »

There's this page here:

viewtopic.php?f=20&t=69575
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: How to Add a menu to the calc menu bar, via macro

Post by Villeroy »

I even know a macro to add a button to a toolbar,
If you would know anything, you could easily find out how to create a toolbar and how easy it is to do it by configuration rather than code (unless someone else writes the code for you, of course).
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
JeJe
Volunteer
Posts: 2764
Joined: Wed Mar 09, 2016 2:40 pm

Re: How to Add a menu to the calc menu bar, via macro

Post by JeJe »

Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
martius
Posts: 56
Joined: Sat Feb 05, 2011 9:41 pm
Location: São Paulo, Brasil

Re: How to Add a menu to the calc menu bar, via macro

Post by martius »

Thank you all and especially jeje for the link https://wiki.openoffice.org/wiki/API/Sa ... rites-Menu
This link was exactly what I needed to learn how to do what I intended. :super: :bravo:
LibreOffice 6.2.8.2 (x64), Windows 10 Home
Post Reply