Edraw Office Viewer Components can disable the office main button and protect the opened document was modified by the end users. Only call the DisableFileCommand method in the BeforeDocumentOpen event and set the different enumerates.

boolean DisableFileCommand([in] WdUIType UIType, [in]
boolean Disable);
UIType: The enum type need to disable in the UI. WdUIType.
Disable: True to disable the command button or menu item.
enum WdUIType
{
wdUIDisalbeOfficeButton = 0×00000001,
wdUIDisalbeNew = 0×00000002,
wdUIDisalbeOpen = 0×00000004,
wdUIDisalbeUpgradeDocument = 0×00000008,
wdUIDisalbeSave = 0×00000010,
wdUIDisalbeSaveAs = 0×00000020,
wdUIDisalbeSendAsAttachment = 0×00000040,
wdUIDisalbeClose = 0×00000100,
wdUIDisalbePrint = 0×00000200,
wdUIDisalbePrintQuick = 0×00000400,
wdUIDisalbePrintPreview = 0×00000800,
wdUIDisalbeSaveAsMenu = 0×00001000,
wdUIDisalbePrepareMenu = 0×00002000,
wdUIDisalbePermissionRestrictMenu = 0×00004000,
wdUIDisalbeSendMenu = 0×00008000,
wdUIDisalbePublishMenu = 0×00010000,
wdUIDisalbeServerTasksMenu = 0×00020000,
wdUIDisalbeCopyButton = 0×00040000,
wdUIDisalbeCutButton = 0×00080000,
wdUIHideMenuHome = 0×01000000,
wdUIHideMenuInsert = 0×02000000,
wdUIHideMenuPageLayout = 0×04000000,
wdUIHideMenuReferences = 0×08000000,
wdUIHideMenuMailings = 0×10000000,
wdUIHideMenuReview = 0×20000000,
wdUIHideMenuView = 0×40000000,
wdUIHideMenuDeveloper = 0×80000000,
wdUIHideMenuAddIns = 0×00100000,
wdUIHideMenuFormat = 0×00200000,
wdUIHideMenuEdit = 0×00400000,
wdUIHideMenuTool = 0×00800000,
}WdUIType;
Note: The component disabled the Office menu, New button and Open
button in default.
DWORD dwDisableCommand = wdUIDisalbeOfficeButton |
wdUIDisalbeNew| wdUIDisalbeOpen;
The function need be set in the BeforeDocumentOpened event.
If you want to enable the three button, follow the samples.
Example
The following vb script shows how to enable the office main menu, new button and open
button.
Sub DocumentOpenedEvent ()
Edword.DisableFileCommand 1 , false ‘wdUIDisalbeOfficeButton
Edword.DisableFileCommand 2 , false ‘wdUIDisalbeNew
Edword.DisableFileCommand 4 , false ‘wdUIDisalbeOpen
End Sub
SCRIPT FOR=OA1 EVENT= DocumentOpened ()
DocumentOpenedEvent()
SCRIPT
The following vb script shows how to diable the saveas and save button.
Sub DocumentOpenedEvent ()
Edword.DisableFileCommand 16 , true ‘wdUIDisalbeSave
Edword.DisableFileCommand 32 , true ‘wdUIDisalbeSaveAs
End Sub
SCRIPT FOR=OA1 EVENT= DocumentOpened ()
DocumentOpenedEvent()
SCRIPT