Subject Property

Microsoft Word Visual Basic

Subject Property

       

Returns or sets the subject text of mail messages used to route a document (for the RoutingSlip object) or the subject text of a letter created by the Letter Wizard (for the LetterContent object). Read/write String.

expression.Subject

expression   Required. An expression that returns one of the objects in the Applies To list.

Example

This example sets the subject and message text for the routing slip associated with Month End.doc.

If Documents("Month End.doc").HasRoutingSlip = True Then
    With Documents("Month End.doc").RoutingSlip
        .Subject = "End of month report"
        .Message = "I need your response on this."
    End With
End If

This example displays the subject of a letter created by the Letter Wizard, unless the subject is an empty string.

If ActiveDocument.GetLetterContent.Subject <> "" Then
    MsgBox ActiveDocument.GetLetterContent.Subject
End If