///////////////////////////////////////////
//Create a new document and add some lines/
///////////////////////////////////////////
var
  doc = Application.NewDocument;
begin
  doc.Lines.Add('This new document was created');
  doc.Lines.Add('using Twistpad script macro.');
end;