Printer Object Question

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: May 2005
Posts: 3
Reputation: javalsu is an unknown quantity at this point 
Solved Threads: 0
javalsu javalsu is offline Offline
Newbie Poster

Printer Object Question

 
0
  #1
May 5th, 2005
I'm having trouble setting the paper size and the paper bin in the printer object. I've tried the following code.

If cboPaperSize.ListIndex = 0 Then
Printer.PaperSize = 1
Else
Printer.PaperSize = 5
End If
If cboPaperSource.ListIndex = 0 Then
Printer.PaperBin = 7
Else
Printer.PaperBin = 4
End If
End If

This works fine at my workstation, but when I run it on a clients computer it crashes here. I haven't really had time to debug it, because I can only make the changes here, and test them there. It's really inefficient. So It may just be one of the two. I'm thinking it might be a paperbin problem, for example if the printers in their collection only have the one bin (manual) then it might crash. Please help.
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: Printer Object Question

 
0
  #2
May 5th, 2005
The only real way to find out, is to have the VB IDE running the program when it crashes, so that the debugger can highlight the problem line. I'm guessing that you are compiling it to an EXE and then running it on the client machine. It may be a paperbin problem if the system doesn't have it on the client machine. You SHOULD be able to test for how many bins there are and if there is only one, just don't mess with it.... let me know what you come up with.
Reply With Quote Quick reply to this message  
Join Date: May 2005
Posts: 3
Reputation: javalsu is an unknown quantity at this point 
Solved Threads: 0
javalsu javalsu is offline Offline
Newbie Poster

Re: Printer Object Question

 
0
  #3
May 6th, 2005
What I ended up doing was created some test functions that attempts to change the bin property, as well as size and orientation. If an error occurs it flags that property as read only and disables the corresponding comboboxes, radio button, etc.
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: Printer Object Question

 
0
  #4
May 6th, 2005
Good Solution. I also appreciate you posting your solution to the site, so that others with similar problems have a chance to fix the same issue. Thanx.
Reply With Quote Quick reply to this message  
Join Date: May 2005
Posts: 3
Reputation: javalsu is an unknown quantity at this point 
Solved Threads: 0
javalsu javalsu is offline Offline
Newbie Poster

Re: Printer Object Question

 
0
  #5
May 6th, 2005
Anytime, I've learned a lot from this site, so I'm more than happy to give back.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC