We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now


Sent Emails not appearing in list

purplesoup asked
Medium Priority
Last Modified: 2013-11-12
I am running GroupWise 7, using Visual Basic and the GroupWise COM API

I have an application that lists GroupWise emails in the sent folder.

I have been told by a user (who it running GroupWise 6.5) that the application does not list all the emails in their sent items folder - they have over a 1,000 and only a small number (about 20) are actually being listed.

The code I am using to list the messages is:

Set GetSentItemsMessageList = gGw.RootAccount.MailBox.Messages.Find("(BOX_TYPE = OUTGOING AND CREATE_DATE >= TODAY -500)")

According to the user "I can see messages from 15/03/2006 12:03 to 20/3/2006 09:48 even though there are emails before this and a few after."

Any thoughts on why not all the emails are being listed?
Watch Question


It may be the "today - 500."  Have you verified that that calculation will give you a date that's a year-and-a-half in the past?  

Or, maybe for some goofy reason, you need to group the calc in parentheses or something... ;)

Or, maybe don't filter on date, just on box type.


All good points.

The actual value isn't fixed - the user can control it. The user started at a default of 50 and tried various settings, but they did not appear to alter what was being returned. If the user tries it with no date calculation - so the search is just "(BOX_TYPE = OUTGOING)" he says he gets "a 440 error" (I am assuming this is a VB 440 automation error - he hasn't sent any further details).

If the same user runs these searches on their inbox it all works well - he can alter the number of days to search etc. So in this case the search will be:


So it is only the sent items folder the user is reporting problems with.

So to summarise: everything we want to do with sent items the user can do successfully with inbox, but just not with sent items.
I realize that it's a semantics thing, but just in case anyone wasn't sure about it - there's only one mailbox, containing received items and sent items, and all of the "folders" are just views of the mailbox with filters on type... and the item types include mail, appointments, tasks, notes, etc. so, the "sent items folder" is actually a search query on the mailbox for type email, outgoing.   This has nothing to do with the Question, though - just a parenthetical comment.

That said, have you looked at this sample VB code?  It may help, it may not, but sometimes it's nice to see what others have done in the same vein:

I don't see anything wrong with your logic or syntax from what you've got posted.  May be somewhere other than in the statement using the message.find method, like where the found messages get enumerated or something...

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts


Just for the record, I have a utility app which I use to help with debugging, and this lists the same emails as the main application, the code however is much simpler:

    Set msgList = gw.RootAccount.MailBox.Messages.Find(searchString)
    If Not msgList Is Nothing Then
        For Each msg In msgList
            mailListBox.AddItem msg.ClassName & " " & msg.Subject
        Next msg
    End If
    Set gw = Nothing
Anyway, I have had a look at the sample code you mentioned and interestingly it uses a different method for listing messages. It enumerates all the GroupWise folders and then presents these to the user as a drop down list. The user then clicks on the list and the messages in the folder display. Thus the messages are listed using this code:

Set GWMessages = GWFolders(cboFolders.ListIndex).Messages

where GWFolders is set from

Set GWFolders = GWRootAccount.AllFolders

I turned this code into a little utility and sent it to the user who was having problems, and hey presto they can see all their sent items.

So it just seems to me that searching for messages using search filter strings, such as with:

Set GetSentItemsMessageList = gGw.RootAccount.MailBox.Messages.Find("(BOX_TYPE = OUTGOING AND CREATE_DATE >= TODAY -50)")

is just not reliable, certainly with GroupWise 6.5, and the alternative method as accessing the folders by number, has to be used.

Any thoughts?

I can't help thinking it may be a limitation of VB?  I get the sense that the messages.find method you're using works, but isn't enumerating everything it finds like the method in the sample code is, so what's displayed isn't what's expected.  


That may be true, but the example does an enumeration after getting the message list:

       Set GWMessages = GWFolders(cboFolders.ListIndex).Messages            
       For Each objMessage In GWMessages

Well, I'll close this as I have a workaround - thanks for your help
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.