1、激活之后,可以通过OleContainer1的OleObject操纵word;
2、隐藏所有的菜单和工具栏之后,OleContainer1里的对象就是固定在OleContainer1那个
区域中,随窗口移动。但是哪些工具条需要隐藏呢?保险的做法是所有的都隐藏:
OleContainer1.DoVerb(0);//激活
OleContainer1.OleObject.CommandBars['Standard'].Visible := false;
OleContainer1.OleObject.CommandBars['Formatting'].Visible:= false;
OleContainer1.OleObject.CommandBars['Menu Bar'].Enabled := false;
OleContainer1.OleObject.CommandBars['Drawing'].Visible:=False;
//以上4个是经常出现在word里的,因此一定要隐藏,下面的也许不必,但有也无妨。
OleContainer1.OleObject.CommandBars['Standard'].Visible:=False;
OleContainer1.OleObject.CommandBars['Formatting'].Visible:=False;
OleContainer1.OleObject.CommandBars['Database'].Visible:=False;
OleContainer1.OleObject.CommandBars['Web'].Visible:=False;
OleContainer1.OleObject.CommandBars['Visual Basic'].Visible:=False;
OleContainer1.OleObject.CommandBars['Tables and Borders'].Visible:=False;
OleContainer1.OleObject.CommandBars['Web Tools'].Visible:=False;
OleContainer1.OleObject.CommandBars['Forms'].Visible:=False;
OleContainer1.OleObject.CommandBars['Control Toolbox'].Visible:=False;
OleContainer1.OleObject.CommandBars['Frames'].Visible:=False;
OleContainer1.OleObject.CommandBars['Picture'].Visible:=False;
3、如果用OleContainer1打开一个word文件,那么如上设置后,位置也是固定的,且不占其它位置。