Class Property (All CDONTS Library Objects)
Class Property (All CDONTS Library Objects)
The Class property returns the object class of the object. Read-only.
Syntax
object.Class
Data Type
Long
Remarks
The Class property contains a numeric constant that identifies the CDO for NTS Library object. The following values are defined:
CDO for NTS Library object |
Class value |
Type library constant |
8 |
CdoAddressEntry |
|
5 |
CdoAttachment |
|
Attachments collection |
18 |
CdoAttachments |
2 |
CdoFolder |
|
3 |
CdoMsg |
|
Messages collection |
16 |
CdoMessages |
4 |
CdoRecipient |
|
17 |
CdoRecipients |
|
0 |
CdoSession |
Example
' Function: Util_DecodeObjectClass
' Purpose: Decode the long integer class value,
' show the related object name
' See documentation topic: Class property
Function Util_DecodeObjectClass(lClass As Long)
' error handling here ...
Select Case (lClass)
Case CdoSession:
MsgBox ("Session object; Class = " & lClass)
Case CdoMsg:
MsgBox ("Message object; Class = " & lClass)
End Select
' error handling ...
End Function
' Function: TestDrv_Util_DecodeObjectClass
' Purpose: Call the utility function DecodeObjectClass for Class values
' See documentation topic: Class property
Function TestDrv_Util_DecodeObjectClass()
' error handling here ...
If objSession Is Nothing Then
MsgBox "Need to set the Session object: Session->LogonSMTP"
Exit Function
End If
' expect type CdoSession = 0 for Session object
Util_DecodeObjectClass (objSession.Class)
Set objMessages = objSession.Inbox.Messages
Set objOneMsg = objMessages.GetFirst
If objOneMsg Is Nothing Then
MsgBox "Inbox is empty"
Exit Function
End If
' expect type CdoMessage = 3 for Message object
Util_DecodeObjectClass (objOneMsg.Class)
' error handling here ...
End Function