Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Sep 2003
    Location
    Oakland, California, USA
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Item Count for any view (any folder, filter applie (Outlook 2000/2002/2003

    Hello, I'm looking for a way to return the number of items SHOWN in current Outlook folder. (Note: users have several versions of OL 2000, 2002, 2003)

    Since ".Count" property seems to work only with "Folders" and "Results" objects... I'm at a loss of how to get just the number of items shown in a "current view" of any OL folder.

    When "Filter Applied" appears on the Status Bar in Outlook (bottom left), why doesn't the count for "Number of Items Shown" appear? I don't want to run code for "Advanced Search" or "Restrict". I just want to get a Count of items shown, (however they are shown, I don't really care).

    So far, I've run Outlook's Mail Merge command to create Envelopes in MS Word, then check the # of pages in the resulting merge document. Tired of doing this!

    With this code as a start, how can I extend it to get accurate results?

    Thanks so much for any help!
    - Glynnis

    Sub ItemsCount()
    Dim ThisFolder
    Set olApp = Outlook.Application
    Set ThisFolder = olApp.ActiveExplorer.CurrentFolder
    Set ThisView = ThisFolder.CurrentView
    'I know this next command doesn't work, but wish it would!
    MsgBox ThisView.Items.Count
    End Sub

  2. #2
    New Lounger
    Join Date
    Sep 2003
    Location
    Oakland, California, USA
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Item Count for any view (any folder, filter applie (Outlook 2000/2002/

    (Edited by HansV to make URL clickable - see <!help=19>Help 19<!/help>)

    I got 2 helpful replies:

    #1) From Sue Mosher http://outlookcode.com/threads.aspx?forumi...messageid=21928
    To get Items Count indirectly, you can execute the Select All command and then get the value of Application.ActiveExplorer.Selection.Count


    #2) JohnBF replied to your post on the Outlook board at Woodys:

    To add to Sue's answer
    http://outlookcode.com/threads.aspx?forumi...messageid=21928 ,
    you will HAVE to use the Restrict method and return the Item count from the
    Restricted collection if you want completely automated code, something
    like (air code):

    Dim myRestrictedItems as Outlook.Items
    Set myRestrictedItems = myItems.Restrict("[Categories] = 'Project X'")
    Debug.Print myRestrictedItems.Count

  3. #3
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Item Count for any view (any folder, filter applie (Outlook 2000/2002/

    I killed my answer because it wasn't helpful. At least you know where I went to look for an answer! <img src=/S/laugh.gif border=0 alt=laugh width=15 height=15>
    -John ... I float in liquid gardens
    UTC -7ąDS

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •