LookupTableEntry.FullName 属性 (Project)
对于大纲代码的 LookupTableEntry ,获取其指定级别和父级别的全名,包括各级别之间的分隔符字符串。 只读 String 类型。
语法
表达式。FullName
表达 一个代表 LookupTableEntry 对象的变量。
示例
CreateLocationOutlineCode 宏示例设置三个 LookupTableEntry 级别的指定 位置 的自定义任务大纲代码。 在执行 CreateLocationOutlineCode 宏之后,在 Visual Basic 编辑器 (VBE) 的 即时窗口中输入以下行返回所示的结果。
Print ActiveProject.OutlineCodes.Item(1).LookupTable.Item(4).FullName
WA.KING.RED
下面是 CreateLocationOutlineCode 宏。
Sub CreateLocationOutlineCode()
Dim objOutlineCode As OutlineCode
On Error GoTo ErrorHandler
Set objOutlineCode = ActiveProject.OutlineCodes.Add( _
pjCustomTaskOutlineCode1, "Location")
objOutlineCode.OnlyLookUpTableCodes = True
DefineLocationCodeMask objOutlineCode.CodeMask
EditLocationLookupTable objOutlineCode.LookupTable
End
ErrorHandler:
MsgBox "CreateLocationOutlineCode(): Error Number: "
& Err.Number & _
vbCrLf & " Error Description: " & Err.Description
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
支持和反馈
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。