OutlineCode Object, OutlineCodes Collection Object

Multiple objects
OutlineCodes
OutlineCode
Multiple objects

Represents an outline code in Project. The OutlineCode object is a member of the OutlineCode collection.

Using the OutlineCodes Collection Object

Use the OutlineCode property to return an OutlineCodes collection.

Using the OutlineCode Object

The following example adds a custom outline code to store the location of resources and configures the outline code such that only values specified in the lookup table can be associated with a resource.

Sub CreateLocationOutlineCode()

    Dim objOutlineCode As OutlineCode
    
    Set objOutlineCode = ActiveProject.OutlineCodes.Add( _
        pjCustomResourceOutlineCode1, "Location")
    
    objOutlineCode.OnlyLookUpTableCodes = True
    
    DefineLocationCodeMask objOutlineCode.CodeMask
    EditLocationLookupTable objOutlineCode.LookupTable
End Sub


Sub DefineLocationCodeMask(objCodeMask As CodeMask)
   objCodeMask.Add _
        Sequence:=pjCustomOutlineCodeUppercaseLetters, _
        Length:=2, Separator:="."
    
   objCodeMask.Add _
        Sequence:=pjCustomOutlineCodeUppercaseLetters, _
        Separator:="."
    
   objCodeMask.Add _
        Sequence:=pjCustomOutlineCodeUppercaseLetters, _
        Length:=3, Separator:="."
End Sub


Sub EditLocationLookupTable(objLookupTable As LookupTable)
    Dim objStateEntry As LookupTableEntry
    Dim objCountyEntry As LookupTableEntry
    Dim objCityEntry As LookupTableEntry
    
    Set objStateEntry = objLookupTable.AddChild("WA")
    objStateEntry.Description = "Washington"
    
    Set objCountyEntry = objLookupTable.AddChild("KING", _
        objStateEntry.UniqueID)
    objCountyEntry.Description = "King County"
    
    Set objCityEntry = objLookupTable.AddChild("SEA", _
        objCountyEntry.UniqueID)
    objCityEntry.Description = "Seattle"
    
    Set objCityEntry = objLookupTable.AddChild("RED", _
        objCountyEntry.UniqueID)
    objCityEntry.Description = "Redmond"
    
    Set objCityEntry = objLookupTable.AddChild("KIR", _
        objCountyEntry.UniqueID)
    objCityEntry.Description = "Kirkland"    
End Sub

Properties | Application Property | CodeMask Property | FieldID Property | Index Property | LinkedFieldID Property | LookupTable Property | MatchGeneric Property | Name Property | OnlyCompleteCodes Property | OnlyLeaves Property | OnlyLookUpTableCodes Property | Parent Property | RequiredCode Property

Methods | Delete Method

Parent Objects | Application Object | Project Object, Projects Collection Object

Child Objects | CodeMask Collection Object | LookupTable Collection Object

See Also | GlobalOutlineCodes Property | OutlineCodes Property