Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Aug 2003
    Location
    Stroud, United Kingdom
    Posts
    548
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Check for subfolders (XP)

    Hi again, is there an easy way of checking if a MAPIFOLDER has subfolders in VBA?
    Thanks,

    pmatz

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Check for subfolders (XP)

    A MAPIFolder object has a Folders property. This collection has a Count.

    Dim nsp As NameSpace
    Dim fld As MAPIFolder

    Set nsp = GetNameSpace("MAPI")
    Set fld = nsp.Folders("Personal Folders").Folders("Lounge Archive")
    MsgBox fld.Name & " has " & fld.Folders.Count & " subfolder(s)"
    Set fld = Nothing
    Set nsp = Nothing

  3. #3
    4 Star Lounger
    Join Date
    Aug 2003
    Location
    Stroud, United Kingdom
    Posts
    548
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Check for subfolders (XP)

    Good thinking Hans! Thanks.
    Thanks,

    pmatz

Posting Permissions

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