#7886
Amy
Participant

The user is not invoking the CommandMessage on an attached message either.

The IT dept did run the GW_CHECK and several other tests and did not find any problems.

The user has no problem with CommandMessage in other applets that run on that message class. (executed via a button on the toolbar).

I have given up trying to figure out why this happening and I’ve moved on to finding an acceptable solution.

Here is my applet code.

  

Sub Main (Client, GWEvent)

on error resume next

dim objMsg, objDraftMsg, g_acct, intMsgID, i, strSubject, strBody

Groupwise.CancelGroupwiseEvent = true
Groupwise.CloseWindow

Set g_acct = Groupwise.Account

Set objMsg = Nothing
Set objMsg = Client.ClientState.CommandMessage

if objMsg is Nothing then 

   msgbox "Message could not be found. Please try again"
   exit sub

end if 

'--- Class Name is GW.MESSAGE.MAIL.MyApp1 or GW.MESSAGE.MAIL.MyApp2
Set objDraftMessage = g_acct.Mailboxes.Messages.Add(objMsg.className) 

strBody = vbcrlf & " <<< " & g_acct.Owner.DisplayName & " " & now & " >>> &
strBody = strBody & vbcrlf & objMsg.BodyText

'--- I then loop through and add any attachments or fields
...

intMsg = objDraftMsg.MessageID
Groupwise.ItemOpen intMsgID, ""

Groupwise.TextSetSubject strSubject, false

objDraftMsg.Delete()

Set g_acct = Nothing
Set objMsg = Nothing

End Sub

I was thinking that I could move the CancelGroupwiseEvent to after I check if the message exists. Then I would exit the applet and not cancel the “Forward” when the message doesn’t exist but I would only want to do this if the user had chosen to “Forward as Attachment”. Otherwise my GW.MESSAGE.MAIL.MyApp1 would be sent as GW.MESSAGE.MAIL

Is there a way to differentiate if the user picked “Forward” or “Forward as Attachment”? There doesn’t seem to be anything in the EventParams object.

Thanks,

Amy