i try to fellow the video
How Do I: Hi-jack or Repurpose a Standard Ribbon Button's Command?
to hi-jack button in word, but failed. the video from MSDN is about outlook 2010 , which has some differences with word/excel....
here is my steps:
1. Add a Ribbon XML item in Word Add-In project;
2. Copy and uncomment CreateRibbonExtensibilityObject() to ThisAddIn.cs;
3. Write OnMySave() in Callbacks region of Ribbon1.cs
Expand|Select|Wrap|Line Numbers
- public void OnMySave(Office.IRibbonControl control, ref bool cancelDefault)
- {
- System.Windows.Forms.MessageBox.Show("Hi-Jack You");
- }
Expand|Select|Wrap|Line Numbers
- <?xml version="1.0" encoding="UTF-8"?>
- <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" onLoad="Ribbon_Load">
- <commands>
- <comand idMso="FileSave" onAction="OnMySave"/>
- </commands>
- <ribbon>
- </ribbon>
- </customUI>
details of what i want to do:
0. i want to build a simple file management system (FMS) which just manages Word, or Excel files;
1. different users access the FMS with different roles, such as canView, canPrint, canEdit, canDelete...
2. the Word or Excel files will be stored in database by BLOB data type;
3. if the role of a person named Lyu is canView (which means he can not print the document), so when Lyu download the BLOB from database and open the document automatically with Word or Excel Application of which the print button should be disable.
regards...