6
I’m trying to print an interval of pages from objeto
OleObject
("word.application")
in the delphi 6
and I’m not getting it.
Using the printout(false) =
I can successfully print, but I want to print a range of pages.
Thank you so much for your help.
Code:
if (OpenDialog1.Execute) then
begin
try
// Cria objeto principal de controle do Word
WinWord := CreateOleObject('Word.Application');
if (not (VarIsEmpty(WinWord))) then
begin
// Mostra o Word
try
WinWord.Visible := false;
Docs := WinWord.Documents;
// Abre um documento
Doc := Docs.Open(OpenDialog1.FileName);
//Doc.PrintOut(false);
//Doc.PrintOut(Copies := 2);
Doc.PrintOut(Background := false, Append := false, Range := wdPrintFromTo, OutputFileName := EmptyParam, From := 1, To := 2);
// erro apresentado: "tipo não correspondente"
finally
// Fecha o Word
//WinWord.close;
//Doc.Close(SaveChanges := 0);
WinWord.ActiveDocument.Close(SaveChanges := 0);
WinWord.Quit;
WinWord := Unassigned;
Docs := Unassigned;
Doc := Unassigned;
end;
end;
//showmessage('Fim!');
finally
end;
end;
It worked. Thank you very much!!
– user3772322