Table of contents
TOC
折叠目录
展开目录

Application.CustomOutlineCodeEditEx 方法 (项目)Application.CustomOutlineCodeEditEx Method (Project)

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

编辑本地大纲代码自定义域定义。Edits a local outline code custom field definition.

语法Syntax

表达式CustomOutlineCodeEditEx(* * FieldID,* *,* 序列长度分隔符 * OnlyLookUpTableCodes,* * OnlyCompleteCodes,* * OnlyLeaves,* *MatchGeneric,* * RequiredCode,* * LookupDefault,* 默认值排序次序)expression. **CustomOutlineCodeEditEx( ** FieldID, ** Level, ** Sequence, ** Length, ** Separator, ** OnlyLookUpTableCodes, ** OnlyCompleteCodes, ** OnlyLeaves, ** MatchGeneric, ** RequiredCode, ** LookupDefault, ** DefaultValue, ** SortOrder* )

表达式_返回应用程序对象的表达式。_expression An expression that returns an Application object.

参数Parameters

名称Name必需/可选Required/Optional数据类型Data Type说明Description
FieldIDFieldID必需RequiredPjCustomFieldPjCustomField指定要编辑的自定义大纲代码。可以为非企业PjCustomField常量之一。Specifies the custom outline code to edit. Can be one of the non-enterprise PjCustomField constants.
级别Level可选OptionalLongLong要编辑的代码掩码的级别。默认值是比当前为域指定的最高级别再高一级的值。The level of code mask to edit. The default value is one greater than the highest level currently specified for the field.
顺序Sequence可选OptionalPjCustomOutlineCodeSequencePjCustomOutlineCodeSequence指定级别中的级别顺序。可以是PjCustomOutlineCodeSequence常量之一。默认值是pjCustomOutlineCodeNumbersThe sequence for the level specified in Level. Can be one of the PjCustomOutlineCodeSequence constants. The default value is pjCustomOutlineCodeNumbers.
长度Length可选OptionalVariantVariant指定给定级别的长度。可以是字符串“Any”或 1 到 255 之间的整数。默认值为“Any”。Specifies the length for a given level. Can be the string "Any" or an integer value from 1 through 255. The default value is "Any".
分隔符Separator可选OptionalStringString指定的级别与下一个级别分开的字符。可以是一种"。","-","+"或"/"。默认值是"。"。The character that separates the level specified in Level from the next. Can be one of ".", "-", "+", or "/". The default value is ".".
OnlyLookUpTableCodesOnlyLookUpTableCodes可选OptionalBooleanBoolean要是查阅表格中列出的代码可以使用;其他。默认值为false,这允许添加其他项。True if only codes listed in the lookup table can be used; otherwise false. The default value is false, which allows additional items to be added.
OnlyCompleteCodesOnlyCompleteCodes可选OptionalBooleanBoolean如此如果只能使用具有掩码的所有级别的值的代码;其他。默认值为falseTrue if only codes with values at all levels of the mask can be used; otherwise false. The default value is false.
LookupTableLinkLookupTableLink可选OptionalLongLong在项目和更高版本中,弃用。本地的大纲代码不能共享查阅表格。Deprecated in Project and later versions. Local outline codes cannot share lookup tables.

警告: 不要使用_LookupTableLink_与全球企业或企业查阅表格。可能会导致数据损坏。Caution Do not use LookupTableLink with the enterprise global or enterprise lookup tables. Data corruption can result.

| |OnlyLeaves|可选 |布尔| ,则返回 true如果只能选择没有附属值的大纲代码值;其他。默认值是false。 ||MatchGeneric|可选 |布尔|如果项目使用的大纲代码,在资源置换向导;其他。默认值是false。 ||RequiredCode|可选 |布尔|如果大纲代码必须提供才允许保存;其他。默认值是false。 ||LookupDefault|可选 |布尔|真正的大纲代码都有一个默认值; 如果其他。默认值是false。 ||默认值|可选 |字符串|指定大纲代码的默认值。 ||排序次序|可选 ||指定是否排序升序、 降序,或查找表的行顺序。可以是PjListOrder常量之一。默认值是pjListOrderDefault。 || | OnlyLeaves|Optional|Boolean|True if only outline code values without subordinate values can be selected; otherwise false. The default is false.| | MatchGeneric|Optional|Boolean|True if Project uses the outline code in the Resource Substitution Wizard; otherwise false. The default is false.| | RequiredCode|Optional|Boolean|True if the outline code must be present before save is allowed; otherwise false. The default is false.| | LookupDefault|Optional|Boolean|True if the outline code has a default value; otherwise false. The default is false.| | DefaultValue|Optional|String|Specifies the default value of the outline code.| | SortOrder|Optional|Long|Specifies whether sorting is ascending, descending, or the lookup table row order. Can be one of the PjListOrder constants. The default is pjListOrderDefault.|

返回值Return Value

BooleanBoolean

注解Remarks

如果只指定_FieldID_参数, CustomOutlineCodeEditEx方法显示指定的大纲代码的代码掩码定义对话框。If only the FieldID argument is specified, the CustomOutlineCodeEditEx method displays the Code Mask Definition dialog box for the specified outline code.

OnlyLeavesMatchGeneric_和_RequiredCode_参数是仅适用于项目的专业人员。The _OnlyLeaves, MatchGeneric, and RequiredCode arguments are available only in Project Professional.

示例Example

下面的示例编辑的任务,在这唯一的代码掩码是现有的大纲代码 1 ""的第一个级别。示例中的第一个命令的CustomOutlineCodeEditEx方法中的默认值,指定第二个级别使用两位数字代码,按数字排序和分开的第三级"-"字符。第二个命令指定第三个级别使用一个大写字母。它还指定可以使用只包含这三个级别的代码。The following example edits an existing **Outline Code 1* for tasks, in which the only code mask is "" for the first level. With default values in the **CustomOutlineCodeEditEx* method, the first command in the example specifies that the second level uses two-digit codes, sorted by number, and is separated from the third level by the "-" character. The second command specifies that the third level uses a single uppercase letter. It also specifies that only codes that contain all three levels can be used.

若要使用该示例,原大纲代码 1包含的第一个级别中的字符"oc1"。运行代码,该代码掩码之后".11 A"。用户可以编辑查阅表格并添加,例如,"23"中下"oc1"和"X"的第三个级别中的级别。当设置大纲代码 1的值,用户可以选择oc1.23 X,但不是可以选择oc1.23To use the example, the original **Outline Code 1* contains the characters "oc1" in the first level. After running the code, the code mask is ".11-A". A user can edit the lookup table and add, for example, "23" in the level under "oc1" and "X" in the third level. When setting the value of **Outline Code 1, the user can choose **oc1.23-X, but can not choose **oc1.23*.

Sub EditCustOutlineCode() 
    CustomOutlineCodeEditEx pjCustomTaskOutlineCode1, Length:=2, _ 
        Separator:="-" 
    CustomOutlineCodeEditEx pjCustomTaskOutlineCode1, Length:=1, _ 
        Sequence:=pjCustomOutlineCodeUppercaseLetters, OnlyCompleteCodes:=True 
End Sub

下面的示例中,在任务大纲代码 3包含查找表中的值"a"、"b"和"c"。运行该示例更改设置的值为"c"时,用户可以看到的顺序"b"和"a"与"b"中的默认值。In the following example, the task Outline Code 3 contains the lookup table values "a", "b", and "c". Running the example changes the order the user sees when setting the value, to "c", "b", and "a", with the default value "b".

Sub ChangeOCDefaults() 
    CustomOutlineCodeEditEx FieldID:=pjCustomTaskOutlineCode3, SortOrder:=pjListOrderDescending 

    CustomOutlineCodeEditEx FieldID:=pjCustomTaskOutlineCode3, LookupDefault:=True, DefaultValue:="b" 
End Sub
© 2018 Microsoft