读书人

OleContainer打开word后,如果屏蔽word

发布时间: 2012-02-16 21:30:36 作者: rapoo

OleContainer打开word后,如果屏蔽word2007的Ribbon菜单下的某些功能
用OleContainer控件打开了一个word文档,现在想让word2007的Ribbon菜单下有些功能不能使用,比如要让“审阅”功能不能使用,应该怎么控制呢! 好像使用CommandBars 及Controls属性无法做到!



解决者,还有其他散分贴
http://topic.csdn.net/u/20100114/10/c4d5165f-140e-4967-8abc-ee5452af9e78.html?63317

[解决办法]
还没有用到2007

支持了
[解决办法]

C/C++ code
Variant SaveBtn = OleContainer->OleObject.OPG("Application").                            OPG("CommandBars").OPG("item","Standard").                            OPG("Controls").OPG("item","保存(&S)");//这个,只能支持中文版本了。2009-11-18            if(SaveBtn.VDispatch)            {                if(SaveBtn.vt!=VT_NULL || SaveBtn.vt!=VT_EMPTY)                {                    SaveBtn.OPS("enabled",FALSE);                }            }
[解决办法]
OlePropertyGet 和OlePropertySet是C++Builder中的方法

Delphi中直接用这样的方式:
OleContainer.OleObject.CommandBars.Item('Standard').Controls.Item('xxx')

读书人网 >C++ Builder

热点推荐