How to write a Project file (*.mpp) using C#

S

Suresh

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
 
M

Maik

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
 
R

Rod Gill

The .mpp file format can't be created, but you can create a project file in
a database or use automation to create a file.

--
For VBA posts, please use the public.project.developer group.
For any version of Project use public.project
For any version of Project Server use public. project.server

Rod Gill
Project MVP
For Microsoft Project companion projects, best practices and Project VBA
development services
visit www.project-systems.co.nz/
Email rodg AT project-systems DOT co DOT nz
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top