Link to home
Start Free TrialLog in
Avatar of winzig
winzigFlag for Czechia

asked on

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

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
Avatar of Bembi
Bembi
Flag of Germany image

LookupTable(index).LookupTableEntry.description?

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
Avatar of winzig

ASKER

Bembi:
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.

Have a look here:
http://msdn2.microsoft.com/en-us/ms453877.aspx
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.
Avatar of winzig

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of Bembi
Bembi
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of winzig

ASKER

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)