• ×
    Information
    Need Windows 11 help?
    Check documents on compatibility, FAQs, upgrade information and available fixes.
    Windows 11 Support Center.
  • post a message
  • ×
    Information
    Need Windows 11 help?
    Check documents on compatibility, FAQs, upgrade information and available fixes.
    Windows 11 Support Center.
  • post a message
Guidelines
Are you having HotKey issues? Click here for tips and tricks.
Check out our WINDOWS 11 Support Center info about: OPTIMIZATION, KNOWN ISSUES, FAQs, VIDEOS AND MORE.
HP Recommended
hp deskjet 2700 series
Microsoft Windows 10 (64-bit)

I'm using Microsoft Excel VBA and would like to know if i can get the user name of the custom paper size.  I can get the paper size enumerated number of the custom paper size, but it is not the same on different computers, the user name of the paper size is.

1 ACCEPTED SOLUTION

Accepted Solutions
HP Recommended

@sbroone 

 

You are welcome.

 

I've not taken the information farther than presented.

 

One thing I'd change from the previous example - change the output format to htable

 

wmic printer get PrinterPaperNames,DriverName /format:htable > C:\Users\Dragon\Documents\Printer_Paper_list_table.html

 

Just neater...

 

Observation:  The data might be better extracted using PowerShell though I've not fully checked into this side of it.

I did - in a previous life - live fully immersed in this world.  My skill level is mostly lost, ancient, and not useful to you.

 

The point is to illustrate that the information is available so you can move forward.

 

Good Luck.

 

Thank you for participating in the HP Community.

Our Community is comprised of volunteers - people who own and use HP devices.

Click Helpful = Yes to say Thanks!

Question / Concern Answered, Click "Accept as Solution"

 

 

Dragon-Fur

View solution in original post

3 REPLIES 3
HP Recommended

@sbroone 

 

Consider ...

 

Open a command prompt window with Admin privileges:

Windows key + X +

Type the wmic command to gather the paper names of the printers in the system

wmic printer get PrinterPaperNames,DriverName

 

Example

wmic printer get PrinterPaperNames,DriverName /format:hform > C:\Users\Dragon\Documents\Printer_Paper_list.html

 

 

Excerpt > Partial Output (for OfficeJet Pro 9025)

PrinterPaperNames{"Letter","Letter Small","Legal","Statement","Executive","A4","A4 Small","A5","B5 (JIS)","Folio","Quarto","Note","Envelope #9","Envelope #10","Envelope #11","Envelope #12","Envelope #14","Envelope DL","Envelope C5","Envelope C6","Envelope C65","Envelope B5","Envelope B6","Envelope","Envelope Monarch","6 3/4 Envelope","German Std Fanfold","German Legal Fanfold","Japanese Postcard","Reserved48","Reserved49","Letter Transverse","A4 Transverse","Letter Plus","A4 Plus","A5 Transverse","B5 (JIS) Transverse","A5 Extra","B5 (ISO) Extra","Japanese Double Postcard","A6","Japanese Envelope Kaku #3","Japanese Envelope Chou #3","Japanese Envelope Chou #4","A5 Rotated","Japanese Postcard Rotated","Double Japan Postcard Rotated","A6 Rotated","Japan Envelope Chou #4 Rotated","B6 (JIS)","B6 (JIS) Rotated","Japan Envelope You #4","PRC 16K","PRC 32K","PRC 32K(Big)","PRC Envelope #1","PRC Envelope #2","PRC Envelope #3","PRC Envelope #4","PRC Envelope #5","PRC Envelope #6","PRC Envelope #7","PRC Envelope #8","PRC 32K Rotated","PRC 32K(Big) Rotated","PRC Envelope #1 Rotated","PRC Envelope #2 Rotated","PRC Envelope #3 Rotated","PRC Envelope #4 Rotated","North America 5x 8","North America 4x 6","North America 5x 7","English Photo L","North America 8x 10","North America 3x 5"," 4 124803x9 5","2L 127x178mm","3.5x5in./L 89x127mm","3x5in.","4x5in./10x13cm","4x6in./10x15cm","4x12in./10x30cm","5x7in./13x18cm","8.5x13in.","8x10in.","Index card A4 8.27x11.69in.","B5 (ISO) 176x250mm","Envelope A2 111x146mm","Index card 3x5in.","Index card 4x6in.","Index card 5x8in.","Index card Letter 8.5x11in.","O**bleep**u hagaki","O**bleep**u hagaki 200x148mm","Letter Half Sheet","Envelope A9","6x4 Landscape","Custom Card 8x6-1/2","Envelope 10 Style"} .

 

 

Check the results against settings

 

Control Panel > icon view > Devices and Printers

Right-Click Printer > Printing Preferences

 

 

Tab Paper / Quality 

Section Paper Options

Paper Size > Custom

Displays paper size list

 

DragonFur_0-1648306915449.png

 

 

Thank you for participating in the HP Community.

Our Community is comprised of volunteers - people who own and use HP devices.

Click Helpful = Yes to say Thanks!

Question / Concern Answered, Click "Accept as Solution"

 

 

Dragon-Fur

HP Recommended

Thank you very much!  This was very helpful, it amazes me all the tools available! What I'm trying to do is associate the value that is returned from the PageSetup object property PageSize to the name for the custom page size that I created. That value is different on every printer  the computer has access to and different every computer that the printer is attached to. Is there a way to make that association? Thanks again for your help!! 

HP Recommended

@sbroone 

 

You are welcome.

 

I've not taken the information farther than presented.

 

One thing I'd change from the previous example - change the output format to htable

 

wmic printer get PrinterPaperNames,DriverName /format:htable > C:\Users\Dragon\Documents\Printer_Paper_list_table.html

 

Just neater...

 

Observation:  The data might be better extracted using PowerShell though I've not fully checked into this side of it.

I did - in a previous life - live fully immersed in this world.  My skill level is mostly lost, ancient, and not useful to you.

 

The point is to illustrate that the information is available so you can move forward.

 

Good Luck.

 

Thank you for participating in the HP Community.

Our Community is comprised of volunteers - people who own and use HP devices.

Click Helpful = Yes to say Thanks!

Question / Concern Answered, Click "Accept as Solution"

 

 

Dragon-Fur

† The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the <a href="https://www8.hp.com/us/en/terms-of-use.html" class="udrlinesmall">Terms of Use</a> and <a href="/t5/custom/page/page-id/hp.rulespage" class="udrlinesmall"> Rules of Participation</a>.