The Printer Object is a little unusual in that there is only one of them, you cannot use New or CreateObject to make new active instances of it. Any variables you set to it reflect the single instance and Properties of those variables are read only, the Methods are unusable.
So the Printer is hardly an object at all, it is just made to behave a bit like one in vb6.
>using a locally created object
They do not behave differently except that their Properties are read/ write and their Methods work.
Code:Private Sub Command4_Click() Dim Obj1 As Object Dim Obj2 As Object Dim Obj3 As Object MsgBox (Command4.Caption) Set Obj1 = Command4 Set Obj2 = Obj1 Set Obj3 = Obj2 Obj3.Caption = "Something else" MsgBox (Command4.Caption) End Sub




Reply With Quote