How do I take over a Word ribbon button

C

Colbert Zhou [MSFT]

Hello Dave,

We can repurpose a default Ribbon button's click event by change command's
onAction property. In the onAction callback function, we got a
CancelDefault parameter. Setting this parameter to false makes the original
function still executed.

There is an article about this topic in MSDN document. You can check it
here,
http://msdn.microsoft.com/en-us/library/bb462633.aspx
It includes codes and video. :)

Hope this helps!

Best regards,
Ji Zhou
Microsoft Online Community Support
 
P

Peter Karlström

Hi David

You can customize Word standard Ribbon with the <commands/> tag like below:

- <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
onLoad="OnRibbonLoad" loadImage="LoadImages">
- <commands>
<command idMso="WindowRestore" enabled="true" onAction="OnActionButton" />
<command idMso="WindowMinimize" enabled="true" onAction="OnActionButton" />
</commands>
- <ribbon startFromScratch="false">


Also, Microsoft has 3 in depth articles about this (links below) which is
worth reading.
http://msdn.microsoft.com/en-us/library/aa338202.aspx
http://msdn.microsoft.com/en-us/library/aa338199.aspx
http://msdn.microsoft.com/en-us/library/aa722523.aspx

Hope this helps
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top