Read-Only Office Viewer for Word, Excel and PowerPoint

Cancel MS Office Standard Command

Edraw Office Viewer Component allows developers to cancel MS Office Standard Command as Save, Print, New or Open command.

Download Office Viewer Component and View Sample Projects

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

Free Download Office Viewer Component

Copyright © EdrawSoft 2004 - 2014. All rights reserved.