Add Milestone in MS Project using Java

This quick guide explains how to add milestone in MS Project using Java. You will get details to set the IDE, a list of programming tasks, and sample code demonstrating how to make a task a milestone in MS Project using Java. A few customizations will also be discussed to create the desired output MPP file with milestones in it.

Steps to Insert Milestone in MS Project using Java

  1. Set the IDE to use Aspose.Tasks for Java to create milestones
  2. Apply the product license to implement the desired feature without a watermark
  3. Load the existing MPP project file into memory
  4. Add a new task titled milestone to the root task in the loaded project
  5. Set the duration of the task to zero and the milestone flag to true
  6. Set the new task calendar to the default calendar of the project
  7. Set the milestone task start date as the event occurrence time
  8. Save the updated project with a new milestone on the disk

These steps summarize how to create milestone in MS Project using Java. Apply the product license, load the project file into memory, add a new task for the milestone, set its duration to zero, and set the IsMilestone flag to true. Set the task calendar to the default calendar in the loaded project, set the milestone task start date to mark the event occurrence date, and save the output Project file.

Code to Add Milestone to MS Project using Java

This code sample demonstrates how to set milestone in MS Project using Java. If you want to be notified of a milestone slippage, set a deadline for the milestone. To make the stricter control over the task, you may set a constraint type and constraint date.

This tutorial provides guidance on working with milestones in an MS Project file. To add recurring tasks in an MPP file, refer to the article Add Recurring Task in MS Project using Java.