WBSCodeMaskEdit Method
Edits the WBS code mask.
Syntax
expression**.WBSCodeMaskEdit(CodePrefix, Level, Sequence, Length, Separator, CodeGenerate, VerifyUniqueness)**
*expression * Optional. An expression that returns an Application object.
CodePrefix Optional String. The WBS code prefix for the project.
Level Optional Long. The level of code mask to edit. The default value is one greater than the highest level currently specified for the field.
Sequence Optional Long. The sequence for the level specified in Level. Can be one of the following PjWBSSequence constants: pjWBSOrderedNumbers, pjWBSOrderedLowercaseLetters, pjWBSOrderedUppercaseLetters, or pjWBSUnorderedCharacters. The default value is pjWBSOrderedNumbers.
Length Optional Variant. Specifies the length for a given level. Can be the string "Any" or an integer value 1-255. The default value is "Any".
Separator Optional String. The character that separates the level specified in Level from the next. Can be one of ".", "-", "+", or "/". The default value is ".".
CodeGenerate Optional Boolean. True if a new WBS code is generated whenever a new task is created.
VerifyUniqueness Optional Boolean. True if new WBS codes are verified to be unique.
Remarks
Using the WBSCodeMaskEdit method without specifying any arguments brings up the WBS Code Definition dialog box.
Example
This example creates a two-level mask for WBS codes. Using the default values for the method, the first line specifies that the first level uses two-digit codes, sorted by number, and is separated from the next level by the "-" character. The second line specifies that uppercase letters, sorted alphabetically, are used for the second level and are separated from the next level by the default "." character. By default, new codes using this mask are generated for each new task and are verified for uniqueness within the project.
Possible results would be in the order 01-A.1, 01-A.2, 01-B.1, 01-B.2, 02-A.1, 02-A.2, 02-B.1, 02-B.2, and so on.
Sub SetNewWBSCode()
Application.WBSCodeMaskEdit Length:=2, Separator:="-"
Application.WBSCodeMaskEdit Length:=1, Sequence:=pjWBSOrderedUppercaseLetters
End Sub
Applies to | Application Object
See Also | WBSCodeRenumber Method | WBSPredecessors Property | WBSSuccessors Property