Add Recurring Task in MS Project using Java

This short guide describes how to add recurring task in MS Project using Java. You will get details to set the IDE, a list of programming steps, and sample code showing how to make recurring task in Microsoft Project using Java. All the details will be provided to customize the recurring tasks and the output MPP file.

Steps to Add Recurring Task in MS Project using Java

  1. Set the IDE to use Aspose.Tasks for Java to create a recurring task
  2. Apply the product license and open the existing MPP file in the Project file
  3. Create a new recurring task with a duration of one hour
  4. Define the repetition pattern of the task as a weekly task with desired weekdays
  5. Set the start and end dates during which the recurring task will be repeated every week
  6. Attach the standard calendar with the recurring task
  7. Add the recurring task to the desired task as a child task
  8. Save the resultant project file and print its information for confirmation

These steps explain how to make a task recurring in MS Project 2016 using Java. Load the license, create an object of the RecurringTaskParameters to create a recurring task, instantiate a WeeklyRepetition object to define the weekdays for the task, define the EndByRecurrenceRange to set start and end dates, and use WeeklyRecurrencePattern to accumulate the above repetition and recurrence range. Link the recurring task with the calendar, and add the recurring task to the target task as a child before saving the resultant project file.

Code for Microsoft Project Repeating Tasks using Java

This code demonstrates the process of generating a recurring task in Microsoft Project. Consider using the EndAfterRecurrenceRange to end repetition after N occurrences instead of a date range. You can access recurrences by using Task.isRecurring() for a clearer check, use RecurringTaskInfo.getOccurrences() to get the total number of generated occurrences, and use RecurringTaskInfo.getUseEndDate() to confirm which end condition is applied.

This guide assists in working with the recurring tasks in MS Project. To open an XER file without Primavera software, refer to the article Open XER File in Java.