VB Creating a Custom Value List for a Field

E

Evan S. Dictor

I am creating a custom field in Project with code similar
to this:

Set oTableField = Application.Projects(1).TaskTables
(1).TableFields.Add(pjTaskText1, pjLeft, 10,
sMaterialsName, pjCenter, -1, True)

Now I would like to add a Value List to this Field.
However, it appears that I can only add a Value List to
a "custom field" using the CustomFieldValueList????
methods of the Application object.

I guess I'm confused about how to create a Custom Field as
opposed to the field I am creating with the
TableFields.Add logic above.

Thanks in advance,
Evan
 
G

Gérard Ducouret

Hello Evan,
Try the following macro,

Gérard Ducouret

Sub ListDeroulante()
SelectTaskColumn Column:="Text10"
CustomFieldValueListAdd FieldID:=pjCustomTaskText10, Value:="Tintin",
Description:="Reporter"
CustomFieldValueListAdd FieldID:=pjCustomTaskText10, Value:="Milou",
Description:="Dog"
CustomFieldValueListAdd FieldID:=pjCustomTaskText10, Value:="Haddock",
Description:="Captain"
CustomFieldValueList FieldID:=pjCustomTaskText10, ListDefault:=False,
RestrictToList:=True, DisplayOrder:=pjListOrderDefault
CustomFieldRename FieldID:=pjCustomTaskText10, NewName:="Hergé"
CustomFieldProperties FieldID:=pjCustomTaskText10,
Attribute:=pjFieldAttributeValueList, SummaryCalc:=pjCalcNone,
GraphicalIndicators:=False, Required:=False
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top