Ver Mensaje Individual
  #8  
Antiguo 28-07-2004
RyAr RyAr is offline
Miembro
 
Registrado: oct 2003
Posts: 74
Reputación: 21
RyAr Va por buen camino
Bueno, al final he dado con el número, era el 8 paraq ue muestre el cuadro de dialogo de la impresora. Por si alguine quiere el codigo, sería el siguiente para pasar valores a excel e imprimirlos.

Código Delphi [-]
uses
...ComObj, OleServer;

procedure TForm1.Button2Click(Sender: TObject);
var
  ExcelApp: OLEVariant;
  fichero: string;
  DlgPrint: OleVariant;
begin
  ExcelApp := CreateOleObject('Excel.Application');
  try
    fichero:=ExtractFilePath(ParamStr(0))+'Plantilla.xls';
    ExcelApp.Workbooks.Open(fichero);
    ExcelApp.cells.item[5,'D']:=Edit1.Text;
    ExcelApp.cells.item[7,'I']:=12;
    ExcelApp.cells.item[8,'I']:=20;
    DlgPrint := ExcelApp.Dialogs.Item[8];
    DlgPrint.Show;
  finally
    if not VarIsEmpty(ExcelApp) then
    begin
    ExcelApp.DisplayAlerts := False;
    ExcelApp.Quit;
    ExcelApp := Unassigned;
    end;
  end;
end;

Gracias por haberme ayudado a sacar este codigo

Saludos

Última edición por RyAr fecha: 28-07-2004 a las 16:07:59.
Responder Con Cita