PDA

View Full Version : Custom UI Editor - how do I add a group to tab created in a different workbook ?



pplanch
10-20-2021, 03:41 AM
I just started with Office Ribbon Editor to include a custom tab on my ribbon. The idea is to have buttons from various workbooks (later to be converted to add-ins) on the SAME custom tab.

The creation of the tab with the first button group worked fine ... see XML code below :


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<customUI xmlns=(note this is redacted because the forum apparently denies posts with URL's in them ... it contains the URL to the 2006-01 custom schemas)>
<ribbon>
<tabs>
<tab id="piAddIns" label="pi Add-ins" insertAfterMso="TabHome" >
<group id="piGeneralSettings" label="General Settings" >
<button id="piRegistration" label="Registration" size="large" onAction="UpdateRegistrationSettings" imageMso="AccountSettings" />
<button id="piLanguage" label="Language" size="large" onAction="SelectLanguage" imageMso="MailMergeRecepientsUseOutlookContacts" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>

The problem I have is to then in ANOTHER workbook add XML code that will add that workbook's button to this "new" tab that I just created (called "piAddIns"). I tried XML code below (with variants of id, idQ and idMSO) to no avail. If I could get some help to figure this out (or pointers to what I'm doing wrong), that would be fantastic ...


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<customUI xmlns= (note this is redacted because the forum apparently denies posts with URL's in them)>
<ribbon>
<tabs>
<tab idQ="piAddIns" label="pi Add-ins" >
<group id="piDatePicker" label="Date Picker" insertAfterQ="piGeneralSettings" >
<button id="piPickDate" label="Pick a Date" size="large" onAction="DatePickerMacro" imageMso="CalendarsGallery" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>

Artik
10-21-2021, 04:20 PM
Below is a simple example for three files. Separate groups are created in all three files, but in the third file a button is added to the group of the first file.
1st file:
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
xmlns:nsWb1="My Shared Tab">
<ribbon
startFromScratch="false">
<tabs >
<tab
idQ="nsWb1:QMySharedTab"
insertBeforeMso="TabHome"
label="My Shared Tab" >
<group
idQ="nsWb1:QGroup1"
label="Group 1"
visible="true">
<button
id="Button1"
label="Button1 in Group1"
visible="true"
onAction="Button1_onAction"/>
</group >
</tab >
</tabs >
</ribbon >
</customUI >
2nd file:

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
xmlns:nsWb2="My Shared Tab">
<ribbon
startFromScratch="false">
<tabs >
<tab
idQ="nsWb2:QMySharedTab"
insertBeforeMso="TabHome"
label="My Shared Tab" >
<group
idQ="nsWb2:QGroup2"
label="Group 2 from Wkb2"
visible="true">
<button
id="Button2"
label="Button2 in Group2"
visible="true"
onAction="Button2_onAction"/>
</group >
</tab >
</tabs >
</ribbon >
</customUI >
3th file:

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
xmlns:nsWb3="My Shared Tab">
<ribbon
startFromScratch="false">
<tabs >
<tab
idQ="nsWb3:QMySharedTab"
insertBeforeMso="TabHome"
label="My Shared Tab" >
<group
idQ="nsWb3:QGroup3"
label="Group 3 from Wkb3"
visible="true">
<button
id="Button3"
label="Button3 in Group3"
visible="true"
onAction="Button3_onAction"/>
</group >
<group
idQ="nsWb3:QGroup1"
label="Group 1"
visible="true">
<button
id="Button4"
label="Button 4 from Wkb3"
visible="true"
onAction="Button4_onAction"/>
</group >
</tab >
</tabs >
</ribbon >
</customUI >

pplanch
10-21-2021, 10:30 PM
Artik, this is EXACTLY what I was looking for. Thanks for your fast and to-the-point reply. I'll get working on this right away.

I'm new to this forum, it's great to have such a success in using it from the start :-)

As a tangential question ... could you help point me to the right way to include code with the nice lay-out like you did in posts on this forum ?

Thanks again

Paul_Hossler
10-22-2021, 11:34 AM
could you help point me to the right way to include code with the nice lay-out like you did in posts on this forum ?

Just use the [#] icon to add
and tags

29082


Paste your macro, etc. between them, or paste your code, selected it, and then the [#] icon

Of course, if you're KB-oriented, you can type the tags

Artik
10-22-2021, 02:14 PM
I use two tools to build and edit the ribbon:
1. RibbonX Visual Designer (https://github.com/fernandreu/office-ribbonx-editor) by Andy Pope
2. Office RibbonX Editor (https://andypope.info/vba/ribboneditor_2010.htm) by Fernando Andreu.


And Paul explained to you how to post code on the forum.



Artik

pplanch
10-22-2021, 08:20 PM
Thanks, Paul. Probably should have been able to figure that out myself then ;-)

pplanch
10-22-2021, 08:21 PM
Artik, thanks again for the feedback. RibbonX Editor is unfortunately not (yet) available for ARM-based system (I've been in touch with Fernando over Github on that topic), so until further notice I'm building the XML into the workbooks using Office Ribbon Editor (I'm running Win11 Insider Preview ARM on and M1 Mac).

Paul_Hossler
10-23-2021, 02:14 PM
I use two tools to build and edit the ribbon:
1. RibbonX Visual Designer (https://github.com/fernandreu/office-ribbonx-editor) by Andy Pope
2. Office RibbonX Editor (https://andypope.info/vba/ribboneditor_2010.htm) by Fernando Andreu.
Artik


Not a big deal, but the links for the descriptions are switched

https://github.com/fernandreu/office-ribbonx-editor

https://andypope.info/vba/ribboneditor_2010.htm

Artik
10-23-2021, 03:36 PM
:oops:
Artik