954,551 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Printer Object Question

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.

javalsu
Newbie Poster
3 posts since May 2005
Reputation Points: 10
Solved Threads: 0
 

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.

Comatose
Taboo Programmer
Team Colleague
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
 

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.

javalsu
Newbie Poster
3 posts since May 2005
Reputation Points: 10
Solved Threads: 0
 

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.

Comatose
Taboo Programmer
Team Colleague
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
 

Anytime, I've learned a lot from this site, so I'm more than happy to give back.

javalsu
Newbie Poster
3 posts since May 2005
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You