How to Extract Microsoft Project Metadata in Java

This quick tutorial provides steps and code to extract Microsoft Project metadata in Java. An MPP Project file can have a lot of metadata information like author, calendar, comments, creation date, currency code, date format, manager name, project name, and many more. Hence, using this tutorial you will not only get information on how to extract Microsoft Project metadata in Java but also get hints about setting project metadata.

Steps to Extract Microsoft Project Metadata in Java

  1. Using the Maven Repository, add a reference to Aspose.Tasks in your project to fetch project metadata
  2. Using the Project class object, open the MPP file whose metadata is to be fetched
  3. Access the project metadata from the loaded file using the Prj enumerator
  4. Display the project metadata information on the console

These steps describe the process to get MS Project metadata in Java by loading it into the Project class object and then using the get() method of Project class to access any of the metadata properties with the Prj enum value. These properties are stored in the string variables and displayed on the console. In the same manner, you can set metadata by providing the Prj enum value along with the desired value to be set.

Code to Retrieve MPP File Metadata in Java

This code loads the sample MPP file into Project class object from the disc and retrieves MPP file metadata using Java. The Prj class contains around 80 properties that can be accessed against a particular project. The same Prj class can be used to set these properties.

We have learned to extract MPP document metadata in Java by following the above steps. However, if you are looking for converting the MS Project file to some other format, refer to the article on how to convert Microsoft Project file to XPS in Java.

 English