![]() |
|
|||||||
|
|
|
Thread Tools | Display Modes |
|
|
|
#1
|
|||
|
|||
|
You can also add ribbon code to the styles manager that will add the button to the tab created by the ribbon manager template. You will need to modify the ribbon xml to make this work. For your ribbon manager: Code:
<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui"
xmlns:nsHost="rbnManager">
<ribbon startFromScratch="false">
<tabs>
<tab idQ="nsHost:Company" label="Company">
<group idQ="nsHost:newGroup" label="New">
<menu id="mnuMemo"
size="large"
label="Memo"
imageMso="NewPageOneNote">
<button id="btnCreateMemo"
label="New memo"
onAction="mMemo.CreateNewMemo"/>
<button id="btnEditMemo"
label="Edit memo"
onAction="mMemo.EditMemo"/>
</menu>
</group>
</tab>
</tabs>
</ribbon>
</customUI>
Code:
<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui"
xmlns:nsClient="rbnManager">
<tabs>
<tab idQ="nsClient:Company">
<group idQ="nsClient:newGroup">
<button id="btnStyleManager"
label="Paragraph Styles"
onAction="ShowfrmParagraphStylesIfNecessary"/>
</group>
</tab>
</tabs>
</ribbon>
</customUI>
|
|
#2
|
|||
|
|||
|
Thank you, Italophile! Your suggestion led me to the following solution. I've implemented it in the main .dotm file (not necessary to put any in the secondary one). Here's the relevant code:
This is the relevant code: Code:
<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui"
xmlns:nsHost="rbnManager"
xmlns:nsClient="rbnManager">
<ribbon startFromScratch="false">
<tabs>
<tab idQ="nsHost:Company" label="Company">
<group idQ="nsHost:newGroup" label="New">
<menu id="mnuMemo"
size="large"
label="Memo"
imageMso="NewPageOneNote">
<button id="btnCreateMemo"
label="New memo"
onAction="mMemo.CreateNewMemo"/>
<button id="btnEditMemo"
label="Edit memo"
onAction="mMemo.EditMemo"/>
</menu>
</group>
<group idQ="nsClient:styleManagerGroup" label="Style Manager">
<button id="btnStyleManager"
label="Paragraph Styles"
size="large"
imageMso="NewPageOneNote"
onAction="mStyleManager.ShowfrmParagraphStylesIfNecessary"/>
</group>
</tab>
</tabs>
</ribbon>
</customUI>
|
|
| Tags |
| ribbon control, xml |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| instance a new dotm file from a Word dotm file and save with new file name | David Peck | Word VBA | 3 | 08-18-2023 06:47 AM |
| Dissociate instance of a custom ribbon, for documents based on the same dotm creation template? | Ddadoo57 | Word VBA | 7 | 03-21-2023 05:34 AM |
Word Custom Ribbon In .dotm - How to edit/create?
|
s0me0nesmind1 | Word | 6 | 04-16-2020 04:10 PM |
Custom ribbon button or shortcut for a specific function
|
Nicobisgaard | Word | 6 | 04-22-2015 04:39 AM |
| Is it possible to add a custom macro button to the FILE tab of the ribbon in excel | sbapabck | Excel | 2 | 04-11-2014 07:36 AM |