MS Project 2003 pro - how to get list of allowed values for enterprise project text. field

Posted on 2006-05-30
Last Modified: 2013-11-15
Hi I need to write Macro for VBA which displays list of values which are in lookup table for Enterprise text field.

PS I dont need code which gets LookUptable for Enterprise Outline but for Enterprise Text !!!

Set LookUpTable = Application.GlobalOutlineCodes(name).LookupTable
Question by:winzig
    LVL 35

    Expert Comment


    Have a look at the object model, which can be found within the Visual Basic help for project.

    MS Project Visual Basic Language Reference --> MS Office Project Objects
    LVL 10

    Author Comment

    When i have reference to LookUp Table i'm able read Lookup table content, my problem is that I don't know how to get LookUp table for Enterprise text field.

    LVL 35

    Expert Comment

    Have a look here:
    It is just an example for local LookupTables, but as you have the option to access most of the fields directly asa well as by using a generic object with a constant, have a look at this sequence:

     Set objOutlineCode = ActiveProject.OutlineCodes.Add( _
                             pjCustomResourceOutlineCode9, "Location")

    As I remember (I have only limmeted acces at the moment, there is also a set of constants for the enterprise Outline codes. Have a look at the VB object explorer and there at the pjCustomFields List definition, there you find the constants i.e. pjCustomProjectEnterpriseOutlineCode_xx as constant definition. In this way, you should be able to access all Enterprise fileds definitions.

    Haveing the OutlineCode object, you should be able to enter the LookupTable properties of that object.
    LVL 10

    Author Comment

    Bembi:I know haw to reed information from lookup table which is assigned to Enterprise Outine code, but my problem is different, I have Enterprise Text field (and i know haw to read value) but i don't know hat to read list of values which can be stored in Enterprise Text Field.
    LVL 35

    Accepted Solution

    CustomFieldValueListGetItem(FieldID As PjCustomField, Item As PjValueListItem, Index As Long) As String

    PjCustomField is the constant for the EnterpriseTextfield

    to read the lookuptable

    To get back the selected value, just use GetField
    GetField(FieldID As PjField) As String

    with the same constants

    Have I hit your question now?
    LVL 10

    Author Comment

    You sollution works.

    By the way do you know where is stored information haw many items are stored in the List ?

    Dim a As String
    Dim b As String
    Dim Item As PjValueListItem
    a = CustomFieldValueListGetItem(pjCustomProjectEnterpriseText5, Item, 1)
    b = CustomFieldValueListGetItem(pjCustomProjectEnterpriseText6, Item, 1)

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    At the office, we’ve started to get serious about organizing what we’re doing. I mean, it was getting to the point where every time I received a phone call, it began with “I know you’re really busy, but…” My boss was taking tasks away from me left a…
    Article by: x-men
    Where used to see Gantt charts for illustrating project timelines, but what if I wanted to visualize passed timed events? Here's how.
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now