Search code examples
mpxj

How to know the exact MS Project version using MPXJ Library


I need to know the exact MS Project version of the file that is uploaded in my system. In the MPXJ library, the ProjectProperties class exposes two apis - getApplicationVersion() and getMppFileType() but they both return an Integer. Which number is mapped to which version is not clearly mentioned. The mpxj documentation explains that the getMppFileType returns 12 for MS Project 2003 and 2007 and 14 for 2010 and 2013. But how to distinguish between the both ? Is there a single straight-forward api that can give this info ?


Solution

  • Unfortunately it doesn't appear that the exact version of Microsoft Project used to create a file is embedded in the file itself. At the moment the closest you can get is to look at the application version attribute, i.e. you want to use the ProjectProperties.getApplicationVersion() method. Here's the list of possible values it will return:

    Project 98:   8
    Project 2000: 9
    Project 2002: 9
    Project 2003: 9
    Project 2007: 12
    Project 2010: 14
    Project 2013: 15
    Project 2016: 16
    Project 2019: 16