Re: How to display description of value instead of this value? by stevencraigmiller(at)comcast(dot)net>
stevencraigmiller(at)comcast(dot)net>
Wed Jul 02 10:47:02 PDT 2008
To: Avkokin.
Okay, how about this? (The long line of names will need to be straighten out.)
Sub TestReturnNameOfPaperSizes()
MsgBox ReturnNameOfPaperSizes(wdPaperA4)
MsgBox ReturnNameOfPaperSizes(wdPaperTabloid)
End Sub
Function ReturnNameOfPaperSizes(ByVal iValue As Integer) As String
Const sPaperSizes As String = "Paper10x14, Paper11x17, PaperLetter,
PaperLetterSmall, PaperLegal, PaperExecutive, PaperA3, PaperA4, PaperA4Small,
PaperA5, PaperB4, PaperB5, PaperCSheet, PaperDSheet, PaperESheet,
PaperFanfoldLegalGerman, PaperFanfoldStdGerman, PaperFanfoldUS, PaperFolio,
PaperLedger, PaperNote, PaperQuarto, PaperStatement, PaperTabloid,
PaperEnvelope9, PaperEnvelope10, PaperEnvelope11, PaperEnvelope12,
PaperEnvelope14, PaperEnvelopeB4, PaperEnvelopeB5, PaperEnvelopeB6,
PaperEnvelopeC3, PaperEnvelopeC4, PaperEnvelopeC5, PaperEnvelopeC6,
PaperEnvelopeC65, PaperEnvelopeDL, PaperEnvelopeItaly, PaperEnvelopeMonarch,
PaperEnvelopePersonal, PaperCustom"
Dim vList As Variant
vList = Split(sPaperSizes, ", ")
If iValue >= LBound(vList) And iValue <= UBound(vList) Then
ReturnNameOfPaperSizes = vList(iValue)
End If
End Function
I'm using Word 2000, it is possible that they have added others to this list.
Steven Craig Miller
"avkokin" wrote:
> Hello Steven. Thank you very much. But I meaned other result. Sorry
> for my circuitous manner of describing. I meaned display not
> dimensions, but page format, i.e. not 8,26 inches e.g. but constants
> A4 or other format that correspond to current paper size.
> Gratitude!
>
> On Jul 2, 6:06 pm, StevenM <stevencraigmiller(at)comcast(dot)net>
> wrote:
> > To: Avkokin,
> >
> > Sub PaperSize()
> > Dim pWidth As Long
> > Dim pHeight As Long
> >
> > pWidth = ActiveDocument.PageSetup.PageWidth
> > pHeight = ActiveDocument.PageSetup.PageHeight
> >
> > MsgBox "Page Width: " & PointsToPicas(pWidth) & " picas or " _
> > & PointsToInches(pWidth) & " inches" & vbCr _
> > & "Page Height: " & PointsToPicas(pHeight) & " picas or " _
> > & PointsToInches(pHeight) & " inches"
> > End Sub
> >
> > Steven Craig Miller
> >
> >
> >
> > "avkokin" wrote:
> > > Hello.
> > > There is the code that display information about of paper size:
> > > Sub currentsize()
> > > Dim ps As String
> > > ps = Selection.PageSetup.PaperSize
> > > msgbox ps
> > > End Sub
> > > But it show in the number. I want to see description thouse. That is
> > > instead of "7" (for example) I want to see description that. How?
> > > Thank you.- Hide quoted text -
> >
> > - Show quoted text -
>
>