////////////////////////////////////////////////
//insert a signature via an input query dialog//
////////////////////////////////////////////////
var
  doc, name;

begin
  if Application.DocumentCount > 0 then
  begin
    doc  := Application.ActiveDocument;
    name := '';
  
    if InputQuery('Name query', 'Enter your name', name) then
    begin
      doc.Lines.Add('');
      doc.Lines.Add('Regards, ');
      doc.Lines.Add(name + '.');
    end;
  end;
end;
