none
Need to access Enterprise Custom Fields in MSProject VSTO AddIn RRS feed

  • Question

  • Running VS 2010, MSProject 2010, ProjectServer 2010.

    I'm trying to write an add-in to validate the user's changes to Project Enterprise Custom Fields. The validation has to be accomplished by calling an existing web service. Calling the web service is not a problem. I just need to get access to the fields and their values.

    I am handling the Project.Change event, which gets fired when I change value of a field in the Project Information dialog, this gives me an instance of the Project class. Can anyone tell me how to get to the fields from there - or any other route.

    Thanks

    • Moved by Cindy Meister MVP Thursday, July 15, 2010 8:55 AM not VSTO-specific (From:Visual Studio Tools for Office)
    Wednesday, July 14, 2010 11:49 PM

Answers

  • I suggest you get the basic code working in VBA first, then it's easy to port to VSTO.
     
    For Project level Enterprise fields:
    activeproject.ProjectSummaryTask.GetField(application.FieldNameToFieldConstant("Enterprise Field Name",pjProject))
     
    For Task Fields:
    activeproject.tasks(1).GetField(application.FieldNameToFieldConstant("Enterprise Field Name",pjTask))
     
    For Resource Fields:
    activeproject.Resources("My Resource").GetField(application.FieldNameToFieldConstant("Enterprise Field Name",pjResource))

    --

    Rod Gill
    Microsoft MVP for Project - http://www.project-systems.co.nz
     
    Author of the only book on Project VBA, see: http://www.projectvbabook.com
     

     
    "jmorga24" wrote in message news:79586b63-19c8-4ea1-b404-81edfe6122dc...

    Running VS 2010, MSProject 2010, ProjectServer 2010.

    I'm trying to write an add-in to validate the user's changes to Project Enterprise Custom Fields. The validation has to be accomplished by calling an existing web service. Calling the web service is not a problem. I just need to get access to the fields and their values.

    I am handling the Project.Change event, which gets fired when I change value of a field in the Project Information dialog, this gives me an instance of the Project class. Can anyone tell me how to get to the fields from there - or any other route.

    Thanks



    __________ Information from ESET Smart Security, version of virus signature database 5280 (20100715) __________

    The message was checked by ESET Smart Security.

    http://www.eset.com

    The one and only Project VBA Book Rod Gill Project Management
    • Marked as answer by jmorga24 Thursday, July 15, 2010 3:38 PM
    Thursday, July 15, 2010 10:02 AM
    Moderator

All replies

  • Hi jmorga

    The best place to find out how to work with an individual application's object model is a forum specific for that application. The VSTO forum mainly targets the VSTO technology, which in the case of Project is just the framework for creating the add-in (registration, security, loading in the Office application). But there's very little Project-specific knowledge in the forum.

    So I'm moving your question to a forum for Project.


    Cindy Meister, VSTO/Word MVP
    Thursday, July 15, 2010 8:55 AM
  • I suggest you get the basic code working in VBA first, then it's easy to port to VSTO.
     
    For Project level Enterprise fields:
    activeproject.ProjectSummaryTask.GetField(application.FieldNameToFieldConstant("Enterprise Field Name",pjProject))
     
    For Task Fields:
    activeproject.tasks(1).GetField(application.FieldNameToFieldConstant("Enterprise Field Name",pjTask))
     
    For Resource Fields:
    activeproject.Resources("My Resource").GetField(application.FieldNameToFieldConstant("Enterprise Field Name",pjResource))

    --

    Rod Gill
    Microsoft MVP for Project - http://www.project-systems.co.nz
     
    Author of the only book on Project VBA, see: http://www.projectvbabook.com
     

     
    "jmorga24" wrote in message news:79586b63-19c8-4ea1-b404-81edfe6122dc...

    Running VS 2010, MSProject 2010, ProjectServer 2010.

    I'm trying to write an add-in to validate the user's changes to Project Enterprise Custom Fields. The validation has to be accomplished by calling an existing web service. Calling the web service is not a problem. I just need to get access to the fields and their values.

    I am handling the Project.Change event, which gets fired when I change value of a field in the Project Information dialog, this gives me an instance of the Project class. Can anyone tell me how to get to the fields from there - or any other route.

    Thanks



    __________ Information from ESET Smart Security, version of virus signature database 5280 (20100715) __________

    The message was checked by ESET Smart Security.

    http://www.eset.com

    The one and only Project VBA Book Rod Gill Project Management
    • Marked as answer by jmorga24 Thursday, July 15, 2010 3:38 PM
    Thursday, July 15, 2010 10:02 AM
    Moderator
  • Thanks, that's just what I needed.
    Thursday, July 15, 2010 3:39 PM