
Edraw Office Viewer Component allows developers to cancel MS Office Standard Command as Save, Print, New, Open command.
Download Office Viewer Component and View Sample Projects
void DisableStandardCommand([in] CommandType CmdType, [in]
BOOL Disable);
Disables the standard file, save, print commands.
You can disable the standard commands in the office ocx. Then write your own process in the event.
enum CommandType{
cmdTypeSave = 0x00000001,
cmdTypeClose = 0x00000002,
cmdTypePrint = 0x00000004,
cmdTypeRightClick = 0x00000008,
cmdTypeDoubleClick = 0x00000010,
cmdTypeIESecurityReminder = 0x00000020,
}CommandType;
Sample code to cancel the Print event:
function OA_DocumentBeforePrint()
{
document.OA1.DisableStandardCommand(4, true);//cmdTypePrint = 0x00000004,
//add your own code here
}
<script language="javascript" for="OA1" event="DocumentBeforePrint()">
OA_DocumentBeforePrint();
</script>
Sample code to do own right click command:
function OA_DocumentBeforeRightClick()
{
document.OA1.DisableStandardCommand(8, true);//cmdTypeRightClick = 0x00000008,
//add your own code here
}
<script language="javascript" for="OA1" event="DocumentBeforeRightClick()">
OA_DocumentBeforeRightClick();
</script>
Free Download Office Viewer Component and View Sample Projects
|
|
|
|||||||||
|
|
|