Cancel MS Office Standard Command

> Edraw Tip > Cancel MS Office Standard Command
author
Posted by James Freeman |
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

download EdrawMind
main page

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

EdrawMax is an advanced all-in-one diagramming tool for creating professional flowcharts, org charts, mind maps, network diagrams, UML diagrams, floor plans, electrical diagrams, science illustrations, and more. Just try it, you will love it!