ISMessagesList.Item

Description

Each of the messages within the collection.

Syntax

object.Item(aIndex)

Part Attribute Type Description
object Required
The object always implements the ISMessagesList interface
aIndex In, Required
int
The index of the message
Restriction: This property is readonly.

Return Value

ISMessage

Example

Display the total amount of the messages and the information about them.

Dim aProvider
Dim aFilter
Dim aPageNumber
Dim aMessages
Dim aMessage
Dim aInfo
Dim i

Set aProvider = Profile.LoadProvider("ADMIN")
set aFilter = Profile.CreateLoadMessagesParams(aProvider.Id)

aFilter.StartIndex = 0
aFilter.CountOnPage = 10

aPageNumber = 1
do
  set aMessages = Profile.LoadMessages(aFilter)  
  if aPageNumber = 1 then
    aInfo = aInfo & "Total Count: " & aMessages.GetCountAll  
  end if 
  
  aInfo = aInfo & vbNewLine & vbNewLine & "------- Page " & aPageNumber & " ----------" & vbNewLine
  aPageNumber = aPageNumber + 1
  
  for i = 0 to aMessages.Count - 1  
    set aMessage = aMessages.Item(i)
    aInfo = aInfo & vbNewLine & (i + 1) & ") The message was sent by " & aMessage.Sender & " on " & aMessage.Sent      
  next
  aFilter.StartIndex = aFilter.StartIndex + aFilter.CountOnPage
loop while aFilter.CountOnPage = aMessages.Count

Profile.MsgBox(aInfo)
Note:

In Profile Client v8 on User Interface Messages can be found in Organisation > Work Centre > Communication > Email.

Version information

Added in v7.8.0