Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to print the sheet using macro but I dont get the backgroud printed in the output.
Anyone who knows the command for enabling background printing.
Also let me know if there is any command for page size in print options.
See SheetPrintDrawBackground in API Guide:
set docprop = ActiveDocument.GetProperties
set ps = docprop.PrintSheetSettings
ps.SheetPrintDrawBackGround = true
ActiveDocument.SetProperties docprop
Not quite working
Below is what my report looks like:-
This is what i get by printing using macro:-
sub export
set docprop = ActiveDocument.GetProperties
set ps = docprop.PrintSheetSettings
ps.SheetPrintDrawBackGround = true
ActiveDocument.SetProperties docprop
ActiveDocument.sheets("Main").print
end sub
The report in viewer
the print document
How it works if you print sheet manually, without macro, and check "draw background"?
If they work differently, it is a bug in API. If they work the same way, you probably miss something.
Regards,
Michael.