Programmatically access a Microsoft Project (MPP) file from C#

前端 未结 5 1119
小蘑菇
小蘑菇 2020-12-28 17:03

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 fr

相关标签:
5条回答
  • 2020-12-28 17:14

    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)
    0 讨论(0)
  • 2020-12-28 17:22

    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.

    0 讨论(0)
  • 2020-12-28 17:23

    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.

    EDIT (2019): I can confirm that it is a very capable product.

    0 讨论(0)
  • 2020-12-28 17:25

    Sourcefourge.net offers a component in Java which can be integrated with .net applications to read MPP files upto MPP 2007 the link is http://mpxj.sourceforge.net/getting-started.html

    0 讨论(0)
  • 2020-12-28 17:37

    You may use Aspose.Tasks for .NET. This component allows you to work with Microsoft Project files. It doesn't require MS Office to be installed on the server, unlike Office Interop. The API is very simple and easy to use. And it provides a rich set of features to read, edit, write, and convert MPP files.

    This component is a normal .NET assembly which can be used with your .NET applications. It works on any Windows OS and in 32/64-bit environments as well.

    Disclosure: I work as developer evangelist at Aspose.

    0 讨论(0)
提交回复
热议问题