It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming Visual Basic Forum

Change Printer in VB6

Moderator: dafunkymunky

Change Printer in VB6

Postby Flippy on Fri May 14, 2010 7:38 am

Hi
I would like to change the printer in VB6 code is this possible

I have tryed Set Printer but it dose not work.

Regards...... Flippy
Flippy
 
Posts: 6
Joined: Fri Jan 30, 2009 12:34 pm

Re: Change Printer in VB6

Postby bytelogik on Sat May 15, 2010 9:46 am

Hi,
Try this:
Code: Select all
Dim P As Object
For Each P In Printers
     If P.Port = "LPT2:" Or P.DeviceName Like "*LaserJet*" Then 'modify to your port
   Set Printer = P
   Exit For
     End If
Next P


Hope this helps.

Good Luck.
bytelogik
 
Posts: 12
Joined: Tue Oct 06, 2009 7:24 pm


Who is online

Users browsing this forum: No registered users and 2 guests