procedure TForm1.Open1Click(Sender: TObject);
begin
  if OpenDialog1.Execute then
    if FileExists(OpenDialog1.FileName) then
    with TForm2.Create(Self) do
    begin
      Caption := Caption + IntToStr(Form1.MDIChildCount);
      Memo1.Lines.LoadFromFile(OpenDialog1.FileName);
    end;
end;

Add a code snippet to your website: www.paste.org