Reputation: 207
With this
ShellExecute(Handle, 'print', PChar(ExtractFilePath(ParamStr(0))+'Test.txt'),
nil, nil, SW_HIDE);
It is possible to print out files.
Is there a way I can use a TStream
instead of a file so that I can print directly from my stream?
Upvotes: 2
Views: 1934
Reputation: 612794
No, you can't use ShellExecute
to print from a Delphi stream. The call to ShellExecute
will result in a different process performing the printing operation. And that different process cannot see your Delphi stream.
A couple of options spring to mind:
ShellExecute
.TRichEdit
and call its Print
method. Andreas Rejbrand has more details here. Upvotes: 4