tags:

views:

4127

answers:

4

What are my options for programmatically accessing a Microsoft Project file? What are the pros and cons of each approach?

I will basically need to import all data from the file into another data structure. Using the Office Interop assembies is low on the preference scale.

+1  A: 

The Microsoft Office API provides programmatic access to MS Project. I have only used it for Word and Excel so I don't know how rich the interface is - you will have to do some digging around on MSDN to find out what you can and can't do.

One of the Java projects at my company uses a commerical product by Aspose which allows applications to manipulate Office documents including Project. It works well for their purposes, but again, they have only used it for Word and Excel so can't offer much advice on Project.

Rik Garner
I purchased the Aspose.Tasks and it worked extremely well.
David Neeck
+4  A: 

Here are the options:

  1. Interop (messy and horribly slow for large projects)
  2. Save project in XML and work with it (messy)
  3. Save project in the database (that's not publishing and it is available for project 2003 only - see ODBC option while saving). I've seen it being used a lot in the integration scenarios
  4. Projette (commercial, $10 per license)
  5. ILog Project Viewer (also commercial)
Rinat Abdullin
+6  A: 

The MPXJ (mpxj.sf.net) library comes in both Java and .Net flavours and will allow you to read and write multiple Microsoft Project file formats using a single consistent API. I am aware of commercial products which use both the Java and the .Net versions of MPXJ without any issues.

Disclaimer: I'm the maintainer of MPXJ.

Jon Iles
Hello Jon, Thanks for your response. Just wondering if we can schedule tasks start/finish dates using MPXJ.like suppose i have added 3 tasks. task 1, task 2. task 3 and task 2 has dependency of finish to start and task 3 has dependency of finish to finish... how would their start/finish dates would be recalculated on the basis of dependencies i added?
Muhammad Adnan
A: 

" I am aware of a commercial products which use the .Net version of MPXJ without any issues. " I have seen one such product (will not name it), following that product I have added references to my C# project... but I need some samples that would show how can I draw the task grid, chart etc.. using the methods of MPXJ?