屏蔽主菜单和右键菜单应该可以吧,比如屏蔽修订和选项功能
//此方法直接按word标准面版来设置属性,
//速度快,但如果用户自定义面版有可能导致出错
procedure SetMenuVisible(const bShow: Boolean);
const
STANDARD_NEWFILE = 1; //工具栏上---新建空白文档(&B)
STANDARD_OPENFILE = 2; //工具栏上---打开(&O)...
FILE_NEWFILE = 1; //新建(&N)...
FILE_OPENFILE = 2; //打开(&O)...
FILE_SAVEAS = 5; //另存为(&A)...
TOOLS_OPTIONS = 19; //选项(&O)...
TOOLS_DEFINE = 18; //自定义(&C)...
TOOLS_TRACE = 7; //修订(&T)
TOOLS_MACRO = 16; //宏(&M)
TRACK_CHANGES_ACCEPT = 6; //右弹菜单---接受修订(&E)
TRACK_CHANGES_REFUSE = 7; //右弹菜单---拒绝修订(&R)
TRACK_CHANGES_SETTRASE = 8; //右弹菜单---修订(&T)
TRACK_CHANGES_TRACEORNOT = 9; //右弹菜单---接受或拒绝修订(&A)...
REVIEWING_TRACE = 6; //工具栏上---修订(&T)
REVIEWING_ACCEPT = 9; //工具栏上---接受修订(&E)
REVIEWING_REFUSE = 10; //工具栏上---拒绝修订(&R)
procedure SetComBar(BarIndex: OleVariant; ConIndex: Integer; bEn: Boolean);
var
tmp: string;
begin
with WordDoc.CommandBars[BarIndex].Controls[ConIndex] do
if ConIndex >= 0 then
begin
tmp := BarIndex;
//ShowMessage(tmp + ' '+ IntToStr(ConIndex));
Set_Enabled(bEn);
Set_Visible(bEn);
end;
end;
begin
SetComBar('Track Changes',TRACK_CHANGES_ACCEPT, bShow);
SetComBar('Track Changes',TRACK_CHANGES_REFUSE, bShow);
SetComBar('Track Changes',TRACK_CHANGES_SETTRASE, bShow);
SetComBar('Track Changes',TRACK_CHANGES_TRACEORNOT, bShow);
SetComBar('Reviewing',REVIEWING_TRACE, bShow);
SetComBar('Reviewing',REVIEWING_ACCEPT, bShow);
SetComBar('Reviewing',REVIEWING_REFUSE, bShow);
end;