unit Unit1;

interface

uses
  Windows, SysUtils, Classes, Controls, Forms, ToolWin, ComCtrls,
  ExtCtrls, Menus, ImgList, OleCtnrs, ActnList;

type
  TForm1 = class(TForm)
    MainMenu1: TMainMenu;
    File1: TMenuItem;
    ControlBar1: TControlBar;
    ToolBar1: TToolBar;
    ToolButton1: TToolButton;
    ToolButton2: TToolButton;
    ToolButton3: TToolButton;
    ToolButton4: TToolButton;
    ImageList1: TImageList;
    About1: TMenuItem;
    ToolButton5: TToolButton;
    OleContainer1: TOleContainer;
    ActionList1: TActionList;
    NewOle: TAction;
    procedure NewOleExecute(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.NewOleExecute(Sender: TObject);
begin
  try
    OleContainer1.InsertObjectDialog;
  except
    MessageBox(0, PChar('Ошибка при попытке внедрения OLE-объекта.'), PChar(Form1.Caption), MB_OK);
    Raise;
  end; {try}
end;

end.
