Text Documents (Writer)
HTML Documents (Writer Web)
Spreadsheets (Calc)
Presentations (Impress)
Drawings (Draw)
Database Functionality (Base)
Formulae (Math)
Charts and Diagrams
Macros and Scripting
Office Installation
Common Help Topics
OneOffice Logo

MonthName Function [VBA]

The MonthName function returns the localised month name of a specified month number.

This constant, function or object is enabled with the statement Option VBASupport 1 placed before the executable program code in a module.

Syntax:


        MonthName(Month as Integer [,Abbreviate as Boolean])
    

Return value:

String

Parameters:

Month: Value from 1 to 12, January to December, whose localised month name needs to be returned.

Abbreviate: Optional. A Boolean value that indicates if the month name is to be abbreviated.

Error codes:

5 Invalid procedure call

Example:


        REM  *****  BASIC  *****
        Option VBASupport 1
        Sub Example-MonthName
         Dim mBirthday as Integer
         mBirthday = 1
         print mBirthday &" "& MonthName(mBirthday,False)
        End Sub