0

I have to read MS Project (MPP) file thru C# however catch is I have to implement filter on runtime and read and do certain processes on top of it.

I have looked or tried if I could do filter by columns either thru Ms Project Interop or MPXJ but didn't fairly get it. Any inputs would be greatly appreciated.

user1480864
  • 1,455
  • 3
  • 16
  • 23
  • Are you looking to automate (e.g. open) the MS Project application and set a filter in the application? Or are you reading the tasks from the MPP file using MPXJ and need to process a filtered set of tasks? – Rachel Hettinger May 19 '21 at 15:04
  • I am looking to automate the process. I should be reading file (thru MPXJ or Project Interop), set filter(s) on runtime and read all tasks to do further operations. – user1480864 May 20 '21 at 02:41
  • 1
    These are two completely different methods (automation of MS Project vs reading the file through MPXJ), so pick one and update your question accordingly, preferably with code you have so far. In short, with automation use the FilterApply method of the application object, then SelectAll and ActiveSelection to get a collection of all tasks in the filter. If reading the MPP file directly using MPXJ, loop through the tasks and only process the tasks that meet the criteria. – Rachel Hettinger May 20 '21 at 03:36
  • Thanks a lot. Your input helped me. I believe question is appropriate. However I could FilterApply then SelectAll to continue. Wondering, if same could be done thru MPJX. I won't prefer to use introp. Anyways. – user1480864 May 21 '21 at 03:08
  • MPXJ allows you to read the various data stored in the static MPP file. Applying a filter is an action that the MS Project application does. Since a filter is nothing more than a set of conditions that can be replicated in code, you can get the same effect looping through tasks with MPXJ by using conditions (eg If statements) to limit the tasks that are processed. – Rachel Hettinger May 21 '21 at 04:58

0 Answers0