none
How to Open Project Professional file of particular project from project server pro-grammatically? RRS feed

  • Question

  • Hello all,

    I am working on project server 2013 right now.

    I am able to create and check in project from my C# application. but is there any way open MPP file of this project from my App.



    Regards, Kartik Ghodasara Associative Software engineer, Synoverge Tech Pvt. Ltd. Ahmedabad Please vote or mark as answer if it helps...

    Monday, January 6, 2014 3:39 PM

Answers

  • This worked for me. jus i have passed wrong project name.

    Regards, Kartik Ghodasara Associative Software engineer, Synoverge Tech Pvt. Ltd. Ahmedabad Please vote or mark as answer if it helps...

    Thursday, January 9, 2014 3:04 PM

All replies

  • Hi Kartik,

    You could check the C# method --Project.checkout-- in the article below:

    http://msdn.microsoft.com/en-us/library/office/gg202280.aspx

    Hope this helps.


    Guillaume Rouyre - MBA, MCP, MCTS


    Monday, January 6, 2014 3:45 PM
    Moderator
  • Hi Guillaume,

    Thanks for your reply,

    i am able to check out the project but all i want is how to download the Microsoft Project Professional(MPP) file for one particular project programmatically. Hope you get this.


    Regards, Kartik Ghodasara Associative Software engineer, Synoverge Tech Pvt. Ltd. Ahmedabad Please vote or mark as answer if it helps...

    Tuesday, January 7, 2014 5:25 AM
  • Hello Folks,

    i have found some code to do the stuff i want to. but it ain't working right now as i don't know what to pass in Filename argument in the FileOpen() method.

    Reference : http://us.generation-nt.com/answer/how-open-winproj-exe-2007-programmatically-c-applicatio-help-96037972.html

     private void start()
            {
                var objProcess = Process.Start(@"winproj.exe", "/s http://servername/pwainstance/");
            }
    
            internal void OpenProjectPlanThroughXMl()
            {
                var backgroundThread = new System.Threading.Thread(new ThreadStart(start));
                backgroundThread.Start();
                System.Threading.Thread.Sleep(10000);
    
                Microsoft.Office.Interop.MSProject.ApplicationClass objProject = new ApplicationClass();
    
                objProject.Visible = false;
                object oMissing = System.Reflection.Missing.Value;
                object oFile = @"<>\myprojectname.published";
                object oUserName = "username";//"MSProjectUser"; // Project server database user
                object oPassword = "password@123";//"tcs@12345"; // project server database password
                object oURL = "http://servername/pwainstance";
                object oFormat = "MSProject.mpp";
                objProject.DisplayAlerts = false;
    
                objProject.FileOpen(oFile, oMissing, PjMergeType.pjDoNotMerge, oMissing, oMissing, oMissing, oMissing, oUserName, oPassword, oFormat, oMissing, PjPoolOpen.pjPoolReadWrite, oMissing, oMissing, oMissing, oMissing);
    
                objProject.ActiveProject.Application.BaselineSave(true, PjSaveBaselineFrom.pjCopyCurrent, PjSaveBaselineTo.pjIntoBaseline, true, true, true);
                objProject.ActiveProject.Application.PublishAllInformation();
            }

    right now i am getting error like "Argument not valid".Please help me out. 


    Regards, Kartik Ghodasara Associative Software engineer, Synoverge Tech Pvt. Ltd. Ahmedabad Please vote or mark as answer if it helps...


    Tuesday, January 7, 2014 9:29 AM
  • This worked for me. jus i have passed wrong project name.

    Regards, Kartik Ghodasara Associative Software engineer, Synoverge Tech Pvt. Ltd. Ahmedabad Please vote or mark as answer if it helps...

    Thursday, January 9, 2014 3:04 PM