winzig
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.GlobalOutlineC odes(name) .LookupTab le
PS I dont need code which gets LookUptable for Enterprise Outline but for Enterprise Text !!!
Set LookUpTable = Application.GlobalOutlineC
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.
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( _
pjCustomResourceOutlineCod e9, "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. pjCustomProjectEnterpriseO utlineCode _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.
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
pjCustomResourceOutlineCod
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. pjCustomProjectEnterpriseO
Haveing the OutlineCode object, you should be able to enter the LookupTable properties of that object.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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 = CustomFieldValueListGetIte m(pjCustom ProjectEnt erpriseTex t5, Item, 1)
b = CustomFieldValueListGetIte m(pjCustom ProjectEnt erpriseTex t6, Item, 1)
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 = CustomFieldValueListGetIte
b = CustomFieldValueListGetIte
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