I've run into a problem moving or holding on to an event message (like an appointment) with our application using the Message ID. I'm using Delphi 7 (soon to move to Delphi 2007). Also, I've just taken on this huge old project, fairly new to the API, and it has tons of complications, so please bear with me.

For example, we access an appointment message generated by our application using the API's Message class. That appointment message is built by our application in a folder called "Temp Events" (which actually is a permanent folder created by our app). The handle for this message is defined in our app by using the Message ID property.

To quickly review my process, a user accepts the appointment from our application, the API "Message.send" command is used and this sends (or commits the acceptance) of the appointment message which works ok. And, as it should, it also automatically moves the message to the trash folder (as indicated it will do in the API docs). Here's a code example:

procedure TCWTask.CreateTaskWithRecips(GWNcc: TGWNCC);
recip, msgList : OLEVariant;
msgID : String;

msgList := GW_Folder.Messages;
if (fTaskType = 12) or (fTaskType = 16) or (fTaskType = 4) then begin // add user to recip list for appts
recip := Gw_Message.Recipients;

msgID := GW_Message.MessageID; //this is the current Message ID I need.

GW_Message.Send; // Sends ok, and puts message in trash folder.

//-fix -Scott
//GW_Message.Clone; //puts new Message ID in, can't use.
//msgList.add(GW_Message.Send); //puts new Message ID in, can't use.

GW_Folder.move(GW_Message,msgList); //invalid number of parameters



The message moving to the trash folder poses a problem for me and our customers. First, the customers tend to like to keep their trash folder emptied. Our application needs to access the message after it's deleted from the trash by a customer using GroupWise. I've found our code in where the Message.send is executed, message is sent (and the appointment will go to the trash automatically by the GW API), but I've found that if I try to clone or add the message back to the "Temp Events" folder after the Message.send procedure, the Message ID obviously changes and the app now loses the handle on the message.

I could probably get the new ID of the clone or add, put it in our database and use that, but we don't want to deal with 2 separate messages of the same kind. I need the original message to stay where it was in the "Temp Events" folder with the same Message ID.

I'm assuming that a Move command would work, but I'm having a difficult time figuring out how to work this procedure and still not sure if a move will keep the same Message ID. So the main question is this: How do I use the Move command or is there something I can do to store the original message in my original folder WITHOUT the message moving to the trash folder when it's sent? Here is a Delphi code example. Notice the bottom line, "invalid number of parameters". This is where I am stuck.

I'm open to other ideas too. Thanks!

Scott Ottesen