Suresh said:
Hello All,
Iam looking for a way to write a Microsoft Project file using C#, without
using any third party tools.
I found lot of material for writing Excel and Word Documents .
Any pointers would be of great help.
Thanks for your time
Suresh
Hello Suresh,
what do you mean with "write" a MS Project File ?
Do you want to create a .mpp File with C# ?
If so , you have to link a reference to the Microsoft Office 11.0 Object
Library,
create an instance for example like this :
Microsoft.Office.Interop.MSProject.ApplicationClass proj = new
Microsoft.Office.Interop.MSProject.ApplicationClass();
Add a Project
proj.Projects.Add(false,System.Reflection.Missing.Value,System.Reflection.Missing.Value);
and save it
proj.ActiveProject.SaveAs("<yourpath>/<yourProjectName>.mpp",Microsoft.Office.Interop.MSProject.PjFileFormat.pjMPP,......,...............);
for each Parameter you don´t want or can give write
"System.Reflection.Missing.Value".
so you can get a new .mpp File
Have a look at the Microsoft Office Project 2003 SDK, under References ->
MS Office Project Object Model, you can use these Objects.
I think there you´ll find what you need.
Maik