Hello
I've been making a print module for a program I'm working on, and I figured it would be somewhat cleaner to avoid setting the built-in Printer object and just use my own. However, whenever I try to use any methods of my own Printer object, I get error 438: Object doesn't support this property or method.
Ex:
vb Code:
Dim MyPrinter As Printer For Each MyPrinter In Printers MsgBox MyPrinter.DeviceName 'this always works MsgBox MyPrinter.ScaleX(15, vbTwips, vbInches) 'this errors Next
However, the following works just fine
vb Code:
Dim MyPrinter As Printer For Each MyPrinter In Printers Set Printer = MyPrinter MsgBox Printer.DeviceName 'this always works MsgBox Printer.ScaleX(15, vbTwips, vbInches) 'this no longer errors Next
I would think that any Printer object should support the same set of methods... so this is really confusing me. I know I could work around it by just using the Printer object instead, but in any case I'd like to know what's going on.




Reply With Quote