Quote:
|
Originally Posted by Smeagol
I bet if you change the .Papersize property to the size of your labels, it would not spit out extras. Check out the sizes that are available by hitting F1, there is also a user-defined .papersize code, that should do it.
|
Thanks for the suggestion. Here is some more info:
There is no .papersize corresponding to the labels I am using but I thought I'd try it anyway. I included three debug lines like this:
Debug.Print Printer.Papersize
Debug.Print Printer.Height
Debug.Print Printer.Width
When it runs the debug window shows :
9
16832
11904
These are the values for A4 paper, which is, presumably the default, and when I print 297mm (16832 twips) of labels are ejected.
If I now precede the debug lines with:
Printer.Papersize = 11
The debug window shows:
11
11904
8384
These are the values for A5 paper and when I print 210mm (11904 twips) of labels are ejected. So far so good.
Help shows 256 as the user defined papersize but you don't set it with Printer.Papersize = 256, that causes an error. You substitute the papersize line with:
Printer.Height = 2160
Printer.Width = 5040 (My label size in twips)
Because the height and width have been set, the .Printer object recognizes that the papersize has been defined by the user and reports it as 256.
The debug window now shows:
256
16832
11904
The Printer object appears to recognise the user size requirement but has substituted the supplied height and width values with the A4 default values.
When I print 297mm of labels are ejected from the printer.
Any ideas welcome!