Platform SDK: CDO 1.2.1 |
The Class property returns the object class of the object. Read-only.
object.Class
Long
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 |
---|---|---|
AddressEntry | 8 | CdoAddressEntry |
Attachment | 5 | CdoAttachment |
Attachments collection | 18 | CdoAttachments |
Folder | 2 | CdoFolder |
Message | 3 | CdoMsg |
Messages collection | 16 | CdoMessages |
Recipient | 4 | CdoRecipient |
Recipients collection | 17 | CdoRecipients |
Session | 0 | CdoSession |
' 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