#7434
Support 1a
Participant

ExpandedRecipients is a property of the Mail object in the Object API. Like all Object API objects, you cannot use them until a message physically exists in the data store. In other words, you cannot create a message in the GroupWise client and expect any Object API methods to work until the message has at least been saved as a draft message. (Hence to the reference to the draft messages in the documentation).

Here’s some sample code that saves a composing item as a draft message, then displays the value of the ExpandedRecipients property. Please note this is sample code, not production code.

  dim oMsg
  dim iMsgID
  dim iWIPPath
 
  ' Save the draft message to the Work in Progress folder
  iWIPPath = GroupWise.Account.Owner.DisplayName & "" & GroupWise.Account.WorkFolder.Name
  groupwise.ItemSaveMessageDraft(iWIPPath)
 
  ' Calling ItemMessageIDFromView immediately after GroupWise.ItemSaveMessageDraft
  ' can result in an X00 ID.
  iMsgID = GroupWise.ItemMessageIDFromView
  iBreakCount = 0
  while (iMsgID = "Token failed execution!") or (iMsgID = "X00")
     Application.ProcessMessages
     utilities.Timer(1)
     Application.ProcessMessages
     iMsgID = GroupWise.ItemMessageIDFromView
     iBreakCount = iBreakCount + 1
     if (iBreakCount > 10) then
       exit sub
     end if
  wend
 
  set oMsg = GroupWise.Account.GetMessage(iMsgID)
  Set oRecipients = oMsg.ExpandedRecipients
 
  For Each oRecipient in oRecipients
    msgbox oRecipient.displayname
  Next
 
  set oMsg = nothing

Advansys Support