I am building a MS Access (2010) application and I'll be printing barcode labels from this application. There are a variety of other reports and forms which will also be printed, using the standard printer settings, however with the barcodes I need it to print to a specific printer, and have to set it to use a special page size.
In my searching I have found the printer object's property "Papersize" which itself has quite a few 'standard' default options including acPRPSLetter for the standard US Letter at 8.5" x 11" and acPRPSA4 for the A4 paper size. None of the preset sizes will work for my use. There is one preset which represents a user custom size, acPRPSUser, but I have not found any way to programmatically set the custom size.
I did read about how there are the '.height' and '.width' properties of the printer, but it does not appear that they exist in the VB used for Access 2010 (I believe it is based on VB6).
Can anyone help me set a custom paper size using VB code in Access 2010?
There is no need for VBA. You can set all page settings for margins, orientation, paper, printer and columns by using the page settings command from the menu: Tools for report designs > Page settings > Page settings > Page > Paper > Size, or > Page > Printer for ReportName > Use specific printer > Printer > Properties. These settings are saved for each induvidual report.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With