Subject
Overview
The Subject
property of a mail item represents the subject line of the email message.
Syntax
Return Value
A String
containing the subject line of the email message. Returns an empty string if no subject is set.
Example
This example demonstrates how to create a mail item and work with the subject:
vba
Sub SubjectExample()
Dim app As New nlsMailer.Application
Dim mailItem As Object
' Create a new mail item using the Application object
Set mailItem = app.CreateItem(olMailItem)
' Set subject
mailItem.Subject = "Weekly Team Meeting Agenda"
' Retrieve subject
Dim currentSubject As String
currentSubject = mailItem.Subject
' Display subject details
Debug.Print "Email Subject: " & currentSubject
End Sub