Application.LookUpTableAdd Method

Project Developer Reference

Appends items to the lookup table of a custom outline code definition.

Syntax

expression.LookUpTableAdd(FieldID, Level, Code, Description, Phonetic)

expression   A variable that represents an Application object.

Parameters

Name Required/Optional Data Type Description
FieldID Required Long Specifies the custom outline code to edit. Can be one of the PjCustomField constants.
Level Optional Long Specifies the level of the new code. The default value is the level of the last item in the lookup table.
Code Optional String The code to be added to the lookup table.
Description Optional String A description for the field specified in Code.
Phonetic Optional Variant

Return Value
Boolean

Remarks

If only the FieldID argument is specified, the LookUpTableAdd method displays the Lookup Table dialog box for the specified custom outline code.

Example
This example illustrates how it is possible to create an invalid entry in a lookup table. The first line correctly adds a new code to the second level of a two-level code mask. The second line, however, causes a problem in the lookup table because the appended code doesn't match the mask for the code; that is, it adds the new code at the third level of a two-level mask.

Visual Basic for Applications
  Sub LookupTableProblem()
    Application.LookUpTableAdd pjCustomTaskOutlineCode1, Level:=2, Code:="Q"
    Application.LookUpTableAdd pjCustomTaskOutlineCode1, Level:=3, Code:="Z"
End Sub

See Also