none
MS Project Add-In Replace Field ID with Variable RRS feed

  • Question

  • Dear Community,

    I'm trying to make a Void in C# for creating custom tables in MS Project. To create them, you need the Field-ID for Methods like Microsoft.Office.Interop.MSProject.Application.CustomFieldPropertiesEx and i want to enter them as parameter. I don't know the type of field ids, VisualStudio shows them like: Microsoft.Office.Interop.MSProject.pjCustomField and you can't replace them with a variable.

    Do you know any way, to replace the FieldID with a variable?

    Thanks in advance,

    Stefan

    Heres a code example, to show what it looks like:

                    //Create Dropdown-List
                    Globals.ThisAddIn.Application.CustomFieldPropertiesEx(FieldID: MSProject.PjCustomField.pjCustomTaskText30,
                        Attribute: MSProject.PjCustomFieldAttribute.pjFieldAttributeValueList, SummaryCalc: MSProject.PjSummaryCalc.pjCalcNone,
                        GraphicalIndicators: false, AutomaticallyRolldownToAssn: false);

    Thursday, January 2, 2020 1:28 PM

All replies

  • Hi stef,

    Since this thread is related to MS Project, I suggest you can ask this question in the Project forum.

    The Visual C# forum discusses and asks questions about the C# programming language, IDE, libraries, samples, and tools.

    Best Regards,

    Timon


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, January 3, 2020 9:12 AM
  • Stefan,

    I'd suggest that you run your field reference variables through the Project application.fieldnametofieldconstant function.  Then you will never need to reference the field IDs directly.

    Good luck, tom 

    Friday, January 3, 2020 3:56 PM