#7883
Support 3
Participant

We could not re-produce the behaviour in here. It may be the GroupWise client or some unknown issue on that user considering the code is working for most of the users. May be you need to run the GWCheck on that user or upgrade the GroupWise client.

You can also place the error handler on the code, so that when it fails to access the message object it prompt the user to some meaningful message. Please see below an example:

  
Sub Main(Client, GWEvent)
  dim objMsg

  if not GetMessage(objMsg, Client) then
    msgbox "Unable to access the message. Please try again"
  end if

  set objMsg = nothing
End Sub


' Access the message.
function GetMessage(byref abjMsg, Client)

  on error resume next
  GetMessage = false

  set abjMsg = nothing
  Set abjMsg = Client.ClientState.CommandMessage

  if not abjMsg is nothing then
    GetMessage = true
  end if

end function

Regards,
Advansys Support