D
Dan Kelly
I'm currently writing an in-house Document Register. One of the aims is to
allow users to print selected documents directly from the Register.
To make things easy, the printer is set once, and documents are scaled to
the appropriate paper size for that printer.
All well and good except that Word is giving me grief when using the full
form of WordApplication.PrintOut.
In order to scale the document being set I am setting PrintZoomPaperWidth
and PrintZoomPaperHeight to the appropriate sizes, however the first call
seems to be ignored.
For example: From a freshly run application (no instance of Winword.exe) in
the background I open the document to be printed using:
WordApp.Documents.Open(Filename, EmptyParam, ....)
I then set various settings as OleVariants, including:
PrintZoomPaperWidth := Printer.PageWidth * 2.48;
PrintZoomPaperHeight := Printer.PageHeight * 2.48;
And call:
WordApp.PrintOut(Background, Append, ... PrintZoomPaperWidth,
PrintZoomPaperHeight);
If I call the above with the default printer set to A4 paper, with an A3
document defined the printer asks for A3 printer, and prints only a portion
of the sent document.
However when I call the procedure a second time (with Winword.exe still
connected) the file is printed properly scaled to A4.
Completely repeatable - if Word is open, the settings are obeyed, if not,
the first print is at actual size, rather than scaled.
Any suggestions?
allow users to print selected documents directly from the Register.
To make things easy, the printer is set once, and documents are scaled to
the appropriate paper size for that printer.
All well and good except that Word is giving me grief when using the full
form of WordApplication.PrintOut.
In order to scale the document being set I am setting PrintZoomPaperWidth
and PrintZoomPaperHeight to the appropriate sizes, however the first call
seems to be ignored.
For example: From a freshly run application (no instance of Winword.exe) in
the background I open the document to be printed using:
WordApp.Documents.Open(Filename, EmptyParam, ....)
I then set various settings as OleVariants, including:
PrintZoomPaperWidth := Printer.PageWidth * 2.48;
PrintZoomPaperHeight := Printer.PageHeight * 2.48;
And call:
WordApp.PrintOut(Background, Append, ... PrintZoomPaperWidth,
PrintZoomPaperHeight);
If I call the above with the default printer set to A4 paper, with an A3
document defined the printer asks for A3 printer, and prints only a portion
of the sent document.
However when I call the procedure a second time (with Winword.exe still
connected) the file is printed properly scaled to A4.
Completely repeatable - if Word is open, the settings are obeyed, if not,
the first print is at actual size, rather than scaled.
Any suggestions?