The main recipient of the letter.
object.MainRecipient
Part | Attribute | Type | Description |
---|---|---|---|
object |
Required | The object always implements the
ISLetter interface |
Display some information about the main and additional recipients of the letter.
sub main
Dim aPatient
Dim aLetters, aLetter
Dim aMainRecipient
Dim aCCRecipients, aCCRecipient
Dim i
Dim aMessage
Set aPatient = Profile.SelectPatient
set aLetters = aPatient.GetLetters (1) ' slcfWordRTF
aMessage =_
"The number of the letters of the selected format is " & aLetters.Count
for i = 0 to aLetters.Count - 1
set aLetter = aLetters.Item(i)
aMessage = aMessage & vbNewLine & "---------------" & vbNewLine &_
"Letter Date: " & aLetter.Date & vbNewLine &_
"Letter Subject: " & aLetter.Subject2 & vbNewLine
set aMainRecipient = aLetter.MainRecipient
if not aMainRecipient is nothing then
aMessage = aMessage & vbNewLine &_
"Main Recipient: " & vbNewLine & GetLetterRecipientInfo(aMainRecipient)
end if
aMessage = aMessage & vbNewLine & "CC Recipients: "
set aCCRecipients = aLetter.CCRecipients
for each aCCRecipient in aCCRecipients
aMessage = aMessage & vbNewLine & GetLetterRecipientInfo(aCCRecipient)
next
next
Profile.MsgBox(aMessage)
end sub
function GetLetterRecipientInfo(aRecipient)
Dim aProvider
Dim aExtProvider
Dim aPOS
Dim aInfo
Dim aLetter
aInfo = vbNewLine &_
" Recipient Type: " & aRecipient.RecipientType & vbNewLine &_
" Is Main: " & aRecipient.IsMainRecipient & vbNewLine
if aRecipient.ProviderId > 0 then
set aProvider = Profile.LoadProviderById(aRecipient.ProviderId)
aInfo = aInfo & " Provider: " & aProvider.FullName & vbNewLine
end if
if aRecipient.ExternalProviderID > 0 then
set aExtProvider = Profile.LoadExternalProviderById(aRecipient.ExternalProviderID)
aInfo = aInfo & " External Provider: " & aExtProvider.FullName & vbNewLine
end if
if aRecipient.PatientId > 0 then
set aPatient = Profile.LoadPatient(aRecipient.PatientId)
aInfo = aInfo & " Patient: " & aPatient.SurnameFirstName & vbNewLine
end if
if aRecipient.LetterId > 0 then
set aLetter = Profile.LoadLetter(aRecipient.LetterId)
aInfo = aInfo & " Letter: " & aLetter.Subject2 & vbNewLine
end if
if aRecipient.PosID > 0 then
set aPOS = Profile.LoadProviderById(aRecipient.PosID)
aInfo = aInfo & " Pos: " & aPOS.FullName & vbNewLine
end if
GetLetterRecipientInfo = aInfo
end function
In Profile Client v8 on User Interface Main Recipient can be found in
or in .