Subject Property

Microsoft Word Visual Basic

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