I am printing the contents of a RichEdit Control using:
Dim rRect As Rect
PrintRichTextBox HWND_FormReports_RICHEDIT1, rRect
I would like to set the Print Dialog Box to Landscape rather than the default Portrait
Can I do that programmatically?
You can include AfxPrint.inc and cal this function:
' ========================================================================================
' Sets the printer orientation.
' DMORIENT_PORTRAIT = Portrait
' DMORIENT_LANDSCAPE = Landscape
' ========================================================================================
FUNCTION AfxSetPrinterOrientation (BYVAL bstrPrinterName AS WSTRING, BYVAL nOrientation AS LONG) AS LONG
Jose, If I don't know the printer name can It there something I can
set bstrPrinterName to so it sets the default printer to Landscape ?
I think I found my answer. I should use:
AfxGetDefaultPrinter () AS WSTRING
You can use the AfxGetDefaultPrinter function.
Jose' why must I specifically include AfxPrint.inc I thought FF35 automatically
include all your includes that are need for the project?
How do I know which of your API includes are automatically included by FireFly
and which ones are not?
AfxPrint.inc is not part of the Windows API headers, but a file with some convenient wrapper functions, that you can use or not.