none
ProjectOpen Event in .NET too soon RRS feed

  • Question

  • Hi!
    System: Project Prof. + Project Server 2007

    I need to check a few things on the project plan as soon as the user opens an enterprise project from the server.
    I want to check enterprise fields and so on.

    I implemented the following code:

     

     

    void _projectApplication_NewProject(Project pj)

    {

    pj.Open += Project_Open;

    }

     

     

    void Project_Open(MSProject.Project pj)

    {

     

     

    //doing stuff

    }

     

    Problem is, that this event happens too soon and if I want to access enterprise fields I get a COMException. If I use the same code afterwards by letting the user click a button, everything works, so it has to do something with the open-event.

    Any recommendations on this?

    Thanks!

    Gerald


    Gerald Tauchner
    Tuesday, November 23, 2010 5:36 PM

Answers

All replies

  • Maybe include a delay for the project to open?

    You could also try using Activate, not certain, but it might load first then activate...

    -Jack


    Jack Dahlgren blogs at:
    Project and Retrovention
    and rarely Twitter
    Tuesday, November 23, 2010 5:58 PM
    Moderator
  • Hi!

    Thanks, I am going to try this (the Activate-Event). I don't like the idea for the delay-idea though, but actually I am using it right now ;o)

    Kind regards,

    Gerald


    Gerald Tauchner
    Thursday, November 25, 2010 7:41 AM