Outlk 2k3 script: How to get the name of the month

  • Thread starter Thread starter news.microsoft.com
  • Start date Start date
N

news.microsoft.com

Hi all,

I want to convert a number (from 1 to 12) to a month name

tks for help
 
Set up a table or array and use your number as an index into the table or
array to find the name.
 
Try this:

Function monthName(myMonth As Integer)
' if you are in an English dating system (m/d/y) then change the code
to:
'MsgBox StrConv(Format(myMonth & "/1/2006", "mmmm"), vbProperCase)
MsgBox Format("1/" & myMonth & "/2006", "mmmm")
End Function

Sub testMonth()
'here you supply the month number you want the name for
monthName (5)
End Sub

Good luck,
BartH
 
Back
Top