Answered by:
Want to export many MSProject's projects to XML automatically.

Question
-
Hi,
I am currently developing a way to connect certain MSProjects' data to a web application that can be easily use by users around the world to update them.
This action is not suppose to be always available, only sometimes, and people will have a certain time to update data.
My strategy is to give a C# application to the responsible of this massive update (which have access to .mpp files) that will export .mpp files in .xml (or other easy-to-use format), upload them to the server and call a PHP script that will parse XML files and 'activate' the update GUI.
The next step will be the same but reverse : PHP script will build XML files, download them to responsible PC and another C# application will update the .mpp files with the XML ones.
Unfortunately, I am stuck to the first step, because doing this :
Microsoft.Office.Interop.MSProject.ApplicationClass msProjectInstance = new ApplicationClass();
for (int i = 0; i != selectedItems.Count; ++i)
{
string url= selectedItems[i].ToString();
msProjectInstance.FileOpen(@url, Missing.Value, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value,
Missing.Value, PjPoolOpen.pjPoolReadOnly,
Missing.Value, Missing.Value, Missing.Value,
Missing.Value);
msProjectInstance.FileSaveAs(@sourceProjects + selectedItems[i].ToString().Substring(0, selectedItems[i].ToString().LastIndexOf('.')) + ".txt",
PjFileFormat.pjTXT, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value);
}
Is prompting the MSProject Export Wizard (which is annoying considering that the usage of MSProject must not be known by user and this must be performed on many projects). It's certainly a miss-understanding of FileSaveAs function (PjFileFormat doesn't have pjXML param and I don't know how to use the eighteenth param XMLName).
Does anyone can give me advice on how exporting .mpp files into .xml files with C#? Thanks alot.
Regards,
- Renaud
PS : We are using MSProject 2007.- Moved by Harry Zhu Wednesday, March 3, 2010 6:31 AM (From:Visual C# Language)
Friday, February 26, 2010 6:25 PM
Answers
-
Ask in a forum here: http://social.msdn.microsoft.com/Forums/en-US/category/projectserver2010,projectprofessional2010/
Thanks!
Ed Price (a.k.a User Ed), SQL Server Customer Program Manager (Blog, Small Basic, Wiki Ninjas, Wiki)
Answer an interesting question? Create a wiki article about it!- Proposed as answer by Ed Price - MSFTMicrosoft employee Saturday, February 23, 2013 11:14 AM
- Marked as answer by Ed Price - MSFTMicrosoft employee Sunday, March 3, 2013 6:33 AM
Saturday, February 23, 2013 11:13 AM
All replies
-
Hi,
The question relating to MSProject is beyond the scope of this forum, I'm moving the thread to : where is the forum for... forum .
The experts there will direct you to the right place for the question.
Thanks,
Harry
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.Wednesday, March 3, 2010 6:31 AM -
Ask in a forum here: http://social.msdn.microsoft.com/Forums/en-US/category/projectserver2010,projectprofessional2010/
Thanks!
Ed Price (a.k.a User Ed), SQL Server Customer Program Manager (Blog, Small Basic, Wiki Ninjas, Wiki)
Answer an interesting question? Create a wiki article about it!- Proposed as answer by Ed Price - MSFTMicrosoft employee Saturday, February 23, 2013 11:14 AM
- Marked as answer by Ed Price - MSFTMicrosoft employee Sunday, March 3, 2013 6:33 AM
Saturday, February 23, 2013 11:13 AM