The code we have to Add an item over into GroupWise using the Object APL in Delphi 6 seems to work fine.

The virtual machine I'm running the app on for testing only has the GroupWise 8 client installed, there's no server on it.

Problem I'm having is the code to try and reach back into GroupWise to find msgs and GWMessage.Retract them.

To be brief, we're trying to do something like this:

GWFolder := GWRootAccount.Calendar;

// sType happens to be "APPOINTMENT"

sFindStr := '(' + sType + ') AND '+
'(MESSAGE CONTAINS "[' + sGWID + ']")';

// I've even tried setting sFindStr to just ''(MESSAGE CONTAINS "[' + sGWID + ']")''
// I easily can verify that our Add process does create
// Calendar items which are Appointments
// which contain ''(MESSAGE CONTAINS "[' + sGWID + ']")" within the message body

GWMessageList := GWFolder.FindMessages(sFindStr);

// NOTE: GWFolder.Messages.Count show a valid non-zero amount
// in a DEBUG Log I'm writing to.

if (not VarIsEmpty(GWMessageList)) AND (not VarIsNull(GWMessageList)) then begin

// Code gets to here and DEBUG log shows GWMessageList.Count = 0!
// so none of this loop happens.

for i := 1 to GWMessageList.Count do begin

GWMessage := UnAssigned; // GDH 03-01-2012

if (not VarIsEmpty(GWMessageList.Item(i))) AND
(not VarIsNull(GWMessageList.Item(i))) then begin

GWMessage := GWMessageList.Item(i);

// do some stuff on our end.... then


(in the Create method of this class is where I do the following...)

// See GW_TLB.pas for CoApplication2
// GW_TLB is an automatically generated Type Library unit
// which gets made by having Delphi create it for the GroupWise Object API DLL

GWApplication := CoApplication2.Create;
bDisabled := VarIsEmpty(GWApplication);
if not bDisabled then begin
GWRootAccount := GWApplication.Login('', egwPromptIfNeeded);
GWMailBoxFolder := GWRootAccount.MailBox;
sGWQualifiedEMailAddress := GWRootAccount.Owner.EMailAddress;
sOwnerDisplayName := GWRootAccount.Owner.DisplayName;