Map ribbon buttons to other tasks?

Because of an XML schema that our organization uses, we need to use the <Strong> style instead of Bold and the <Emphasis> style instead of Italic. It's a snap to map Ctrl-I to <Emphasis> and Ctrl-B to <Bold>

Is there a way to make the same thing happens when using the Bold and Italic buttons in the Home ribbon?

pjs
 

Question Info


Last updated December 21, 2017 Views 104 Applies to:
Using Strong and Emphasis styles instead of manual formatting is a GOOD THING when using the new Theme method of styling documents.

Sorry, I don't know of any easy way to remap the ribbon buttons. 

If you want to use the "Customize the Ribbon" dialog, you cannot even turn off buttons in the default tabs / groups.  You have to turn off the default group, ie "Home tab > Font group" then recreate the Font group.  But when you recreate the group, you can't get it to look the same as default ... Sigh.  I just say this to save you some time, because I tried it and was not happy with the results.

That being said, the only way I know of to make the change you want is you have to edit the native Ribbon XML.  Is that something you want to get into?
*
****** ****** ******** ******** ******* ******* ******
*

When things are bad, you can either:
- cuss,
- cry or
- laugh ...

Why not choose to laugh

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

 

 

Your going to have to put the following code in a standard module name modRepurposeRC:

 

Private Sub OnAction(ByVal control As IRibbonControl, pressed As Boolean, ByRef cancelDefault)
  Select Case control.ID
  Case "Bold"
    If pressed Then
      Selection.Style = "Strong"
    Else
      Selection.Style = "Default Paragraph Font"
    End If
  Case "Italic"
    If pressed Then
      Selection.Style = "Emphasis"
    Else
      Selection.Style = "Default Paragraph Font"
    End If
  End Select
End Sub

 

Then put the followin RibbonXML in the template file:

<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui"

   onLoad="OnLoad" >

<commands>

  <command idMso="Bold" onAction="modRepurposeRC.OnAction" />

  <command idMso="Italic" onAction="modRepurposeRC.OnAction" />

</commands>

</customUI>

 

 

 

Best Regards,
Greg Maxey

For more help with Word visit:
http://gregmaxey.com/word_tips.html

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.