Application.MailProjectMailCustomize Method

Project Developer Reference

Customizes workgroup messages and published fields.

Syntax

expression.MailProjectMailCustomize(Action, Position, FieldID, Title, IncludeInTeamStatus, Editable, UseAssignmentField)

expression   A variable that represents an Application object.

Parameters

Name Required/Optional Data Type Description
Action Optional Long The type of action to be taken. Can be one of the PjCustomizeMailAction constants.
Position Optional Long If Action is pjMailStartFields, the number of fields. The value of Position must be greater than 6 to allow for other fields that are required. If Action is pjMailDefineField, the position of the field specified by FieldID. Required if Action is pjMailStartFields or pjMailDefineField.
FieldID Optional Long The fields to be included in the message. Required if Action is pjMailDefineField. Can be one of the PjMailField constants.
Title Optional Variant Due to changes in the Project object model, this argument no longer has an effect. It has been retained for backwards compatibility.
IncludeInTeamStatus Optional Boolean True if the fields specified with FieldID are included in TeamAssign and TeamStatus messages. False if the fields specified with FieldID are only included in TeamAssign messages. Required if Action is pjMailDefineField.
Editable Optional Boolean True if the field is editable by a resource. Required if Action is pjMailDefineField.
UseAssignmentField Optional Boolean True if Project sets the custom field type to Assignment. False if Project sets the custom field type to Task. The default value is False.

Return Value
Boolean

Remarks

The MailProjectMailCustomize method is available even when no projects are open.

Using the MailProjectMailCustomize method without specifying any arguments displays the Customize Published Fields dialog box.

Example
The following example first sets up how many fields will be defined.

Visual Basic for Applications
  Action:=pjMailStartFields

The next set of lines define each field.

Visual Basic for Applications
  Action:=pjMailDefineField

You must include the definitions of the default fields with the same values for the "IncludeInTeamStatus" and "Editable" arguments. The last line indicates that the definitions are complete .

Visual Basic for Applications
  Action:=pjMailEndFields

It will check for the existence of the default fields and give a run-time error if they are not given. Note: The default fields (Name, Work, Start, Finished, Completed and Remaining Work, and Comments) must be included in every workgroup message. The order of these fields can change, but their basic definition "Editable", "IncludeInTeamStatus" must remain the same as the default.

Visual Basic for Applications
  Sub MailProjectMailCustomize()
    MailProjectMailCustomize Action:=pjMailStartFields, Position:=number of fields
Visual Basic for Applications
  
    MailProjectMailCustomize Action:=pjMailDefineField, Position:=1, FieldID:=constant, Title:="My Title"
    ...
Visual Basic for Applications
  
    MailProjectMailCustomize Action:=pjMailDefineField, Position:=n, FieldID:=constant, Title:="another title"
    
Visual Basic for Applications
  
    MailProjectMailCustomize Action:=pjMailEndFields
End Sub

Where

Visual Basic for Applications
  
    number of fields
  

is the number of fields in the message,

Visual Basic for Applications
  
    constant
  

is one of the "PjMailField" constants,

Visual Basic for Applications
  
    n
  

is the position of the field within the message, and

Visual Basic for Applications
  
    another title
  

is the title of a newly defined field.

See Also