ISMessageRecipients.Item

Description

Each of the number of message recipients.

Syntax

object.Item(aIndex)

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

Return Value

ISMessageRecipient

Example

Display the text of the message, its subject and recipients.

sub main()
  Dim aMes
  Dim aPatient

  set aPatient = Profile.SelectPatient
  set aProvider = Profile.LoadProvider("MM")
  
  Set aMes = Profile.CreateMessage
  aMes.Text = aMes.AddText("Hello! Come to my birthday party")
  aMes.Subject = "Birthday party"     
  aMes.Patient = aPatient  
  aMes.Recipients.AddPatient(aPatient)
  aMes.Recipients.AddProvider(aProvider)
  aMes.Send

  Profile.MsgBox("The message was successfully sent." & vbNewLine &_
    GetMessageInfo(aMes))
end sub


function GetMessageInfo(aMessage)
  Dim aInfo
  Dim aMessageRecipients
  Dim aRecipient
  Dim Message
  Dim i

  aInfo = "Subject: " & aMessage.Subject & vbNewLine &_ 
    "Text: " & aMessage.Text & vbNewLine
     
  if not aMessage.Patient is nothing then
    aInfo = aInfo &_                        
      "Patient: " & aMessage.Patient.SurnameFirstName & vbNewLine
  end if

  set aMessageRecipients = aMessage.Recipients
  for i = 0 to aMessageRecipients.Count - 1
    set aRecipient = aMessageRecipients.Item(i) 
    aInfo = aInfo & "Recipients #" & (i + 1) & ": " &_
      aRecipient.DisplayText & vbNewLine 
  next

  GetMessageInfo = aInfo
end function
Note:

In Profile Client v8 on User Interface Messages Recipients can be found in Organisation > Work Centre > Communication > Email > Open E-Mail > From > To.

Version information

Added in v8.4.18