VBA Printer Device Capabilities

I want to create a macro that list printer and the relative capabilities (paper size and paper bin).

I have found this article: https://msdn.microsoft.com/en-us/vba/access-vba/articles/programmatically-retrieve-printer-capabilities

but this code don't work:

strDeviceName = Application.Printer.DeviceName

strDevicePort = Application.Printer.Port

There is a workaround ?

(I get the list of printer by GetProfileString API)

SolidworksApi macros