Retrieve paperbin info - I can't get this code to work

wackywoo105

Registered User.
Local time
Today, 11:44
Joined
Mar 14, 2014
Messages
203
[Solved] Retrieve paperbin info - I can't get this code to work

I have tried to use the code here to retrive the paperbin info from my printer, but it just gives me an error.

https://msdn.microsoft.com/en-us/library/office/ff197339.aspx

It seems to fail on:

Code:
    lngBinCount = DeviceCapabilities(lpsDeviceName:=strDeviceName, _

Can anyone help me get a working a version of this?
 
Last edited:
I noticed that Web page says "Office 2013 and later" near the top and has a link for other versions (apparently only 2010). Are you using the right one. Also if you have 64 bit Office you will probably have to modify the declare statements as talked about here.
 
I'm using win 10 64 and have access to a win 7 64 pc. I'm running office 2016 32bit.

I tried the 2010 code version to.

In the past I ran office 2010 64 and the declare function would turn red if not compatible. Currently that doesn't happen so I assume that part is OK.
 
I have Windows 7 64 bit and Access 2013 32 bit and the code in installed in the attached database runs fine. I suggest trying it and see if you get the same error. Just open the form and click the button you should get a msgbox with a list of paper sizes.
 

Attachments

Last edited:
That database works fine.

I have just been having a look at the code and I think I am meant to pass the device name to the procedure for the paperbin. I think that may be where my issue lies. I only tested it quickly so didn't realize.

EDIT: And we have a winner. How stupid am i?
 
Well it's a good job I got that code working. The other day knowing 1 and 2 correspond to tray 1 and tray 2 for my Brother MFC-J5720DW Printer, I tried to find out the MP Tray code by trying values 3-15 for paperbin.

None of these worked so I was going to try a few more values going upwards.

I would have been there a while the actual number is 258 :/
 
Last edited:
You probably would have given up long time before you got to 258. I wonder why 258.
 

Users who are viewing this thread

Back
Top Bottom