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
LVL 10
winzigAsked:
Who is Participating?
 
BembiConnect With a Mentor CEOCommented:
CustomFieldValueListGetItem(FieldID As PjCustomField, Item As PjValueListItem, Index As Long) As String

PjCustomField is the constant for the EnterpriseTextfield

to read the lookuptable
pjCustomResourceEntText1-40
pjCustomTaskEntText1-40
pjCustomProjectEnt1-40

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?
0
 
BembiCEOCommented:
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
0
 
winzigAuthor Commented:
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.

0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
BembiCEOCommented:
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.
0
 
winzigAuthor Commented:
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.
0
 
winzigAuthor Commented:
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)
0
All Courses

From novice to tech pro — start learning today.