PDA

View Full Version : Solved: Return Available Paper Names and Sizes



mdmackillop
07-12-2005, 01:10 PM
The following code will return the number constants of paper sizes available. I want to determine the names, xlA4, xlLegal etc. Any ideas?

Sub PaperSizes()
Do
i = i + 1
On Error Resume Next
ActiveSheet.PageSetUp.PaperSize = i
Debug.Print ActiveSheet.PageSetUp.PaperSize
Loop
End Sub

Jacob Hilderbrand
07-12-2005, 02:15 PM
Open the Object Browser and search for xlPaperSize.

You will get a list of all the constants, click on one to get the value.

Ken Puls
07-12-2005, 03:09 PM
Hey Jake,

Malcolm actually wants to populate a combobox with the PaperSize names, I believe. The object broswer isn't really going to work for him for this.

Jacob Hilderbrand
07-12-2005, 03:13 PM
I think you would have to make the list yourself.

PaperB4
PaperB5
PaperCSheet
PaperDSheet
PaperEnvelope10
PaperEnvelope11
PaperEnvelope12
PaperEnvelope14
PaperEnvelope9
PaperEnvelopeB4
PaperEnvelopeB5
PaperEnvelopeB6
PaperEnvelopeC3
PaperEnvelopeC4
PaperEnvelopeC5
PaperEnvelopeC6
PaperEnvelopeC65
PaperEnvelopeDL
PaperEnvelopeItaly
PaperEnvelopeMonarch
PaperEnvelopePersonal
PaperESheet
PaperExecutive
PaperFanfoldLegalGerman
PaperFanfoldStdGerman
PaperFanfoldUS
PaperFolio
PaperLedger
PaperLegal
PaperLetter
PaperLetterSmall
PaperNote
PaperQuarto
PaperStatement
PaperTabloid

Sir Babydum GBE
07-12-2005, 03:35 PM
Missed PaperA4 - the principal British paper size!

Jacob Hilderbrand
07-12-2005, 03:41 PM
You guys always have to be different. Shouldn't it be PaperAU4 tho? :rofl:

MOS MASTER
07-13-2005, 06:37 AM
Missed PaperA4 - the principal British paper size!

Ahumss the principal European size that is! :rofl:

mdmackillop
07-16-2005, 04:00 AM
Thanks to all.
Paper sizes and names resolved here Controlling the Printer from Word VBA (http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=132)

sheeeng
07-16-2005, 09:16 AM
Open the Object Browser and search for xlPaperSize.

You will get a list of all the constants, click on one to get the value.

Wow, I never know paper size can be listed in VBA..:thumb