Cancel MS Office Standard Command - Save, Print, New, Open command

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

Free Download Office Viewer Component

Disable Office Standard Command

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>

Disables Office 2003 Toolbars

Disable Office Ribbon Button

Show/Hide Office Menu Bar

Integrate MS Office in Delphi Program

Embed Office in C# and Do Office Automation

Office Component

Free Download Office Viewer Component and View Sample Projects

Share the page:

Get Started! You Will Love This Easy-To-Use Diagram Software.

Edraw Max is perfect not only for professional-looking flowcharts, organizational charts, mind maps, but also network diagrams, floor plans, workflows, fashion designs, UML diagrams, electrical diagrams, science illustration, charts and graphs... and that is just the beginning!

Top