Compartir a través de


Propiedad OutlineCode.OnlyLookUpTableCodes (Project)

True si sólo las entradas que se enumeran en la tabla de consulta de código de esquema local puede utilizar. Boolean de lectura y escritura.

Sintaxis

expresión. OnlyLookUpTableCodes

Expresión Variable que representa un objeto OutlineCode .

Comentarios

Para los campos de texto de empresa con tablas de búsqueda, OnlyLookUpTableCodes es siempre true y no se puede escribir.

Ejemplo:

En el siguiente ejemplo se agrega un código de esquema personalizado para almacenar la ubicación de los recursos y configurar el código de esquema para que solo se puedan asociar al recurso los valores especificados en la tabla de búsqueda.

Nota:

[!NOTA] La propiedad OnlyLookUpTableCodes puede establecerse sólo después de la tabla de búsqueda contiene entradas. Si intenta establecer OnlyLookUpTableCodes antes de crear entradas de la tabla de búsqueda, el resultado es el error de tiempo de ejecución 7, "memoria insuficiente."

Sub CreateLocationOutlineCode()
    Dim objOutlineCode As OutlineCode 
 
    Set objOutlineCode = ActiveProject.OutlineCodes.Add( _
        pjCustomResourceOutlineCode1, "Location") 
 
    DefineLocationCodeMask objOutlineCode.CodeMask 
    EditLocationLookupTable objOutlineCode.LookupTable 
 
    objOutlineCode.OnlyLookUpTableCodes = True 
 
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

Soporte técnico y comentarios

¿Tiene preguntas o comentarios sobre VBA para Office o esta documentación? Vea Soporte técnico y comentarios sobre VBA para Office para obtener ayuda sobre las formas en las que puede recibir soporte técnico y enviar comentarios.