A
avkokin
Hello.
I create one macro that should to show info about paper size. Then I
tryed make it in function but I get error. That code.Wherein have I
wrong?
Sub psize()
MsgBox IdentifyPaperSize(ps)
End Sub
Function IdentifyPaperSize(ps As String) As String
'Identify Paper Size
Dim iPaperSize As Integer
Dim ps(42) As String
iPaperSize = Selection.PageSetup.papersize
ps(0) = "wdPaper10x14"
ps(1) = "wdPaper11x17"
ps(2) = "wdPaperLetter"
ps(3) = "wdPaperLetterSmall"
ps(4) = "wdPaperLegal"
ps(5) = "wdPaperExecutive"
ps(6) = "wdPaperA3"
ps(7) = "wdPaperA4"
ps(8) = "wdPaperA4Small"
ps(9) = "wdPaperA5"
ps(10) = "wdPaperB4"
ps(11) = "wdPaperB5"
ps(12) = "wdPaperCSheet"
ps(13) = "wdPaperDSheet"
ps(14) = "wdPaperESheet"
ps(15) = "wdPaperFanfoldLegalGerman"
ps(16) = "wdPaperFanfoldStdGerman"
ps(17) = "wdPaperFanfoldUS"
ps(18) = "wdPaperFolio"
ps(19) = "wdPaperLedger"
ps(20) = "wdPaperNote"
ps(21) = "wdPaperQuarto"
ps(22) = "wdPaperStatement"
ps(23) = "wdPaperTabloid"
ps(24) = "wdPaperEnvelope9"
ps(25) = "wdPaperEnvelope10"
ps(26) = "wdPaperEnvelope11"
ps(27) = "wdPaperEnvelope12"
ps(28) = "wdPaperEnvelope14"
ps(29) = "wdPaperEnvelopeB4"
ps(30) = "wdPaperEnvelopeB5"
ps(31) = "wdPaperEnvelopeB6"
ps(32) = "wdPaperEnvelopeC3"
ps(33) = "wdPaperEnvelopeC4"
ps(34) = "wdPaperEnvelopeC5"
ps(35) = "wdPaperEnvelopeC6"
ps(36) = "wdPaperEnvelopeC65"
ps(37) = "wdPaperEnvelopeDL"
ps(38) = "wdPaperEnvelopeItaly"
ps(39) = "wdPaperEnvelopeMonarch"
ps(40) = "wdPaperEnvelopePersonal"
ps(41) = "wdPaperCustom"
IdentifyPaperSize = ps(iPaperSize)
End Function
I create one macro that should to show info about paper size. Then I
tryed make it in function but I get error. That code.Wherein have I
wrong?
Sub psize()
MsgBox IdentifyPaperSize(ps)
End Sub
Function IdentifyPaperSize(ps As String) As String
'Identify Paper Size
Dim iPaperSize As Integer
Dim ps(42) As String
iPaperSize = Selection.PageSetup.papersize
ps(0) = "wdPaper10x14"
ps(1) = "wdPaper11x17"
ps(2) = "wdPaperLetter"
ps(3) = "wdPaperLetterSmall"
ps(4) = "wdPaperLegal"
ps(5) = "wdPaperExecutive"
ps(6) = "wdPaperA3"
ps(7) = "wdPaperA4"
ps(8) = "wdPaperA4Small"
ps(9) = "wdPaperA5"
ps(10) = "wdPaperB4"
ps(11) = "wdPaperB5"
ps(12) = "wdPaperCSheet"
ps(13) = "wdPaperDSheet"
ps(14) = "wdPaperESheet"
ps(15) = "wdPaperFanfoldLegalGerman"
ps(16) = "wdPaperFanfoldStdGerman"
ps(17) = "wdPaperFanfoldUS"
ps(18) = "wdPaperFolio"
ps(19) = "wdPaperLedger"
ps(20) = "wdPaperNote"
ps(21) = "wdPaperQuarto"
ps(22) = "wdPaperStatement"
ps(23) = "wdPaperTabloid"
ps(24) = "wdPaperEnvelope9"
ps(25) = "wdPaperEnvelope10"
ps(26) = "wdPaperEnvelope11"
ps(27) = "wdPaperEnvelope12"
ps(28) = "wdPaperEnvelope14"
ps(29) = "wdPaperEnvelopeB4"
ps(30) = "wdPaperEnvelopeB5"
ps(31) = "wdPaperEnvelopeB6"
ps(32) = "wdPaperEnvelopeC3"
ps(33) = "wdPaperEnvelopeC4"
ps(34) = "wdPaperEnvelopeC5"
ps(35) = "wdPaperEnvelopeC6"
ps(36) = "wdPaperEnvelopeC65"
ps(37) = "wdPaperEnvelopeDL"
ps(38) = "wdPaperEnvelopeItaly"
ps(39) = "wdPaperEnvelopeMonarch"
ps(40) = "wdPaperEnvelopePersonal"
ps(41) = "wdPaperCustom"
IdentifyPaperSize = ps(iPaperSize)
End Function