Table of contents
Collapse the table of content
Expand the table of content

Application.WBSCodeMaskEdit Method (Project)

office 365 dev account|Last Updated: 6/12/2017
1 Contributor

Edits the work breakdown structure (WBS) code mask.


expression. WBSCodeMaskEdit( ** CodePrefix, ** Level, ** Sequence, ** Length, ** Separator, ** CodeGenerate, ** VerifyUniqueness** )

expression A variable that represents an Application object.


NameRequired/OptionalData TypeDescription
CodePrefixOptionalStringThe WBS code prefix for the project.
LevelOptionalLongThe level of code mask to edit. The default value is one greater than the highest level currently specified for the field.
SequenceOptionalLongThe 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.
LengthOptionalVariantSpecifies the length for a given level. Can be the string "Any" or an integer value 1-255. The default value is "Any".
SeparatorOptionalStringThe character that separates the level specified in Level from the next. Can be one of ".", "-", "+", or "/". The default value is ".".
CodeGenerateOptionalBooleanTrue if a new WBS code is generated whenever a new task is created.
VerifyUniquenessOptionalBooleanTrue if new WBS codes are verified to be unique.

Return Value



Using the WBSCodeMaskEdit method without specifying any arguments brings up the WBS Code Definition dialog box.


The following 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 the 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
© 2018 Microsoft