以下程序在Word 2000的“文件”菜单前添加“Custom”菜单,<br>并在其下添加“Import”菜单项。<br> 请仔细研究,我已经调试通过。<br><br>uses ...,ComObj;<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br> WordApp,<br> myMenuBar,<br> newMenu,<br> ctrl1:OleVariant;<br>begin<br> WordApp :=CreateOleObject('Word.application');<br> WordApp.visible:=true;<br> myMenuBar :=WordApp.CommandBars.ActiveMenuBar;<br> newMenu := myMenuBar.Controls.Add(10,1,1,1,true);<br> newMenu.Caption := 'Custom';<br> ctrl1 := newMenu.CommandBar.Controls.Add(1,1,0,1,false);<br> ctrl1.Caption := 'Import';<br> ctrl1.TooltipText := 'Import';<br> ctrl1.Style := 2;<br>end;<br>