Has been a while since my last attempts but I have started experimenting
with C3PO on GW2012 again.

I hooked into the GW.MESSAGE.MAIL eGW_CMDID_OPEN event just fine,
get the message ID, and now try to retrieve some message details with
No shared folders, or proxies, just personal messages.

The exception occurs when calling gwAccount.GetMessage(msgId)

This seems so basic, it must be something pretty simple.
Any suggestion?



' *************************************************

' function called from execute handler
' get details of this message
Dim cCode As String
Dim msgId As String
Dim msgObj As Object ' ObjAPI message object

' actually these objects are stored globally,
' and moved here just for testing purposes
Dim gwCommander As Object ' TokenAPI handle
Dim gwSession As Object ' ObjAPI session object
Dim gwAccount As Object ' ObjAPI account object
Set gwCommander = CreateObject("GroupWiseCommander")
Set gwSession = CreateObject("NovellGroupWareSession")
Set gwAccount = gwSession.Login()

cCode = gwCommander.Execute("itemmessageidfromview()", msgId)

If (cCode = "True") Then
' OK: shows my email address & message id
' like xxxxxxxx.xxxx.xxxxx.xx.xxxxx.x.xxxxx.x
MsgBox ("getCurrentMessage: " & gwAccount.Owner + " -> " + msgId)

' ERR: Object variable or With block variable not set
msgObj = gwAccount.GetMessage(msgId)

' never gets here
MsgBox ("getCurrentMessage(): " & msgObj.Subject )
End If

' *************************************************