procedure Test1;
  var SATFolhaDePgto : OleVariant;
  var frmFolha : OleVariant;
  var frmDlg : OleVariant;
  var dlgImprimir : OleVariant;
begin
  SATFolhaDePgto := Aliases.SATFolhaDePgto;
  frmFolha := SATFolhaDePgto.FrmFolha;
  frmFolha.CmdImprimirRelatorioPersonalizado.ClickButton;
  SATFolhaDePgto.ppPrintPreview.Close;
  frmFolha.CmdImprimirResumo.ClickButton;
  frmDlg := SATFolhaDePgto.FrmDlg;
  frmDlg.Panel1.Edit2.SetText('1');
  frmDlg.Panel2.CmdOK.ClickButton;
  dlgImprimir := SATFolhaDePgto.dlgImprimir;
  dlgImprimir.Close;
  frmFolha.CmdImprimirTotais.ClickButton;
  dlgImprimir.Close;
  frmFolha.CmdFechar.ClickButton;
end;