Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > Delphi: ActiveX/СОМ/CORBA > Как вставить свой пункт меню?


Автор: Pakshin A. S. 10.11.2004, 20:09
Код

{ ... } 
var 
  CBar: CommandBar; 
  MenuItem: OleVariant; 
  { ... } 

{ Add an item to the File menu } 
  CBar := Word.CommandBars['File']; 
  MenuItem := CBar.Controls.Add(msoControlButton, EmptyParam, EmptyParam, 
    EmptyParam, True) as CommandBarButton; 
  MenuItem.Caption := 'NewMenuItem'; 
  MenuItem.DescriptionText := 'Does nothing'; 
{Note that a VB macro with the right name must exist before you assign it to the item!} 
  MenuItem.OnAction := 'VBMacroName'; 
{ ... } 

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)