#7996
ctaleck
Participant

I found this code, but it does not work also. I get “X00” as the ID during the while loop.

   
  dim oMsg
  dim iMsgID
  dim iWIPPath
  Dim iBreakCount

  ' Save the draft message to the Work in Progress folder
  iWIPPath = GroupWise.Account.Owner.DisplayName & "" & GroupWise.Account.WorkFolder.Name
  Utilities.Trace "iWIPPath=" & iWIPPath
  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
     Utilities.Trace iBreakCount & ": " & iMsgID
     if (iBreakCount > 10) then
       exit sub
     end if
  wend

  set oMsg = GroupWise.Account.GetMessage(iMsgID)