Search code examples
vbams-project

Getting view options in Microsoft Project using VBA


If I want to change the current date format to 20, for example, I can use the command

OptionsViewEx DateFormat:=20

but how can I get the current date format (or any other view option for that matter)?


Solution

  • DefaultDateFormat should be the function to use.

    oldvalue = Application.DefaultDateFormat
    Application.DefaultDateFormat = 20 ' or = pjDate_mm_dd_yyyy
    

    This gets or sets the default date format. (technet)

    This gives the complete list of format types.