You can use ....
"How To Open the Printer Properties Dialog"
http://support.microsoft.com/kb/198860
However, while this example shows how to display a dialog for all available
printers, this will not work for DataReport. The DataReport uses only the
"Default Printer". You will need to modify the sample to select and open
only the default printer.
Again, selecting a different printer, changing its properties, and then
attempting to print to that printer - WILL NOT WORK.
Thus also, you can not use any of the Printer APIs or the Printer Object.
This works for the Application but is ignored by the DataReport.
You can allow the user to change the default printer before initializing the
report by using the common dialog.
CmnDlg.ShowPrinter
But note this changes the default printer for ALL apps. So you will need to
call this again for the user to set the "default printer" back. This is a
major failing of the DataReport in my opinion.
-ralph
I misunderstood you. I saw "page setup" and read "printer setup", and
confused your question with your next concerning topmargins for first and
subsequent pages.
[And the fact that problems with 'printing' and printers is usually the next
stubbling block for DataReport programmers. <g>]
You can not specifically set the DataReport margins for different pages, but
you can change the LeftMargin, RightMargin, TopMargin, and BottomMargin for
the whole report (as well as the size of the reports container) before
running it.
' uses twips
With dr
' the window
.Height = 12000
.Width = 12000
' the report
.TopMargin = 500
.BottomMargin = 500
.Caption = "My Report for " & CStr(Now())
.Show vbModal
End With
But note there is a flaw here. These settings affect how the report looks in
the container but often export poorly to other 'viewers' or when printed.
When exporting you will likely need to provide a "template" and do a little
trial 'n error.
hth
-ralph