Introduction


- Disconnected architecture
- LINQ extensibility
- Generate MPP file in a generalized manner
- Accessing data from project file in its essence
- Refinement- Child tasks
- Secure for web application
Prerequisites
Microsoft Project should be installed on your machine.
In order to use this library, you can use the following procedure.
- Add a reference to the provided DLL.
- Import Abhi.MILE.
- Create a List object of type MppTask and a reference variable of type MPPProject.
- // Creating a List variable of type MppTask
- List<MppTask> lsMppTasks;
- // Creating a reference variable of type MPPProject
- MPPProject project;
- Declare a string variable "path" to store the location of the MPP file and store the path in it.
- // Creating a string variable to store the path of Mpp file
- String path;
- path=”Your path here”;
- After storing the path, just instantiate an object of MPPProject Class as per the class definition.
- // Creating an object of type MPPProject
- project = new MPPProject(path);
- Retrieve all tasks present in the mpp file through the object created in the last step. Invoke the GetAllTasks method and store all tasks present in a list variable created in Step 3.
- // Invoking GetAllTasks() Method to retrieve all tasks present in MPP file
- lsMppTasks = project.GetAllTasks();
- Now you have a project object that contains all tasks, subtasks, and resources present in the Mpp file. Using a List variable we can access subtasks and all other fields or properties of a specific task as shown below:
Now the lsMppTask object can be used to access the entire information present in the MPP file using methods as shown in the Class specification. In this way, the library can be used for accessing all information present in an MPP file.
- // Retrieving Name of the first task
- Firsttask.text=lsMpptasks[0].Name;
- // Retrieving the name of the First child of the first task
- FirstChildOfFirstTask.text= lsMpptasks[0].ChildTasks[0].Name;
- // Retrieving the start date of the First child of the first task
- ChildTaskStartDate.Text = lsMpptasks [0].ChildTasks[0].StartDate.ToString();
- // Retrieving the name of the second child of the first task
- SecondChildOfFirstTask.Text = lsMpptasks [0].ChildTasks[1].Name;
- Similarly, we can create an MPP File by creating a list of MppTasks and pass them into the CreateMppFile method of the MppProject class.
- // Creating a List variable of type MppTask to store task information
- List<MppTask> lsMppTasks;
- //Creating a MppTask object and initializing some properties
- MppTask task1=new MppTask();
- task1.Name=”Task1”;
- task1.StartDate=”30/09/2012”;
- task1.FinishDate=”10/11/2012”;
- //Creating another MppTask object and initializing some properties
- task2.StartDate=”12/09/2012”;
- task2.FinishDate=”01/11/2012”;
- //Adding both Mpptask objects to List object
- lsMppTasks.Add(task1);
- lsMppTasks.Add(task2);
- /*Invoking CreateMppFile Method of project class to create a Mpp file with all information present in List object */
- project .CreateMppFile(lsMppTasks,”D:/My_MppFile.mpp”);
For all remaining properties and methods, kindly refer to the class specification given before.
Reference(s)

Fathy GeaiessahPosted Jun 23, 2022, 4:24 AM
New MPPProject(path) can not open file before created
Fathy GeaiessahPosted Oct 16, 2021, 4:09 PM
I can not create a new mpp file
MdaudPosted Jul 26, 2021, 3:16 PM
Can you update the included dll file? It was compiled in 2014 and can't be used in lastest version of projects. Throwing com component error. Seems it used 32 bit compile
Ramya AkulaPosted Jul 19, 2019, 6:53 AM
Saves file with default name Mympp.mpp
Ramya AkulaPosted Jul 19, 2019, 6:52 AM
Saves file with default name out.mpp
Ramya AkulaPosted Jul 19, 2019, 6:51 AM
Why there is no customization in saving file.
Ivan JovanovicPosted Mar 10, 2016, 11:31 AM
Hi Abhisek, did you ever test this? It doesn't seem to work for me...