wimmeyvaert
asked on
Printing amount of copies of Word Document from Delphi-app ...
Hi experts,
I want to print a word-document from my delphi-application (preferable is that Word itself won't open).
I want to be able to dynamically determine the documentname and number of copies to print.
Please feed me with some code if possible.
Thanks in advance,
The Mayor.
I want to print a word-document from my delphi-application (preferable is that Word itself won't open).
I want to be able to dynamically determine the documentname and number of copies to print.
Please feed me with some code if possible.
Thanks in advance,
The Mayor.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi shaneholmes,
I will take a closer look at the example.
I'll be back ...
Best regards,
The Mayor.
I will take a closer look at the example.
I'll be back ...
Best regards,
The Mayor.
ASKER
Hi shaneholmes,
It works !!!!
I looked at the URL you gave in your second comment. Ther I found the complete anwser to my question.
This is the solution I used :
var
DocFile, PrnFile,
Background, Append, Range, OutputFileName,
From, To_, Item, Copies, Pages, PageType,
PrintToFile, Collate, FileName,
ActivePrinterMacGX, ManualDuplexPrint: OleVariant;
Doc, Word : OleVariant;
begin
DocFile := 'C:\test.doc';
PrnFile := 'c:\test.prn';
Word := CreateOleObject('Word.Docu ment.6');
Background := False;
Append := EmptyParam;
Range := 0;
OutputFileName := PrnFile;
From := '';
To_ := '';
Item := 0;
Copies := 1;
Pages := '1';
PageType := 0;
PrintToFile := True;
FileName := DocFile;
Collate := EmptyParam;
ActivePrinterMacGX := EmptyParam;
ManualDuplexPrint := EmptyParam;
word.Application.Visible := false;
Word.Application.PrintOut( Background ,
Append,
Range,
OutputFileName,
From,
To_,
Item,
Copies,
Pages,
PageType,
PrintToFile,
Collate,
FileName,
ActivePrinterMacGX);
Thanks a lot for the fast response !
Best regards,
The Mayor.
It works !!!!
I looked at the URL you gave in your second comment. Ther I found the complete anwser to my question.
This is the solution I used :
var
DocFile, PrnFile,
Background, Append, Range, OutputFileName,
From, To_, Item, Copies, Pages, PageType,
PrintToFile, Collate, FileName,
ActivePrinterMacGX, ManualDuplexPrint: OleVariant;
Doc, Word : OleVariant;
begin
DocFile := 'C:\test.doc';
PrnFile := 'c:\test.prn';
Word := CreateOleObject('Word.Docu
Background := False;
Append := EmptyParam;
Range := 0;
OutputFileName := PrnFile;
From := '';
To_ := '';
Item := 0;
Copies := 1;
Pages := '1';
PageType := 0;
PrintToFile := True;
FileName := DocFile;
Collate := EmptyParam;
ActivePrinterMacGX := EmptyParam;
ManualDuplexPrint := EmptyParam;
word.Application.Visible := false;
Word.Application.PrintOut(
Append,
Range,
OutputFileName,
From,
To_,
Item,
Copies,
Pages,
PageType,
PrintToFile,
Collate,
FileName,
ActivePrinterMacGX);
Thanks a lot for the fast response !
Best regards,
The Mayor.
WordApplication1.Connect;
WordDocument1.PrintOut(); //here is where you decribe all your parameters example: copies
WordApplication1.Disconnec
WordApplication1.Quit;
Shane