Results 1 to 3 of 3

Thread: Outlook Folders

  1. #1
    Join Date
    Sep 2003
    Location
    Leeds, West Yorkshire, UK
    Posts
    12

    Unanswered: Outlook Folders

    Could anyone tell me if i'm on the right track.

    I need to check a differnt folder than the default inbox

    Set Olfolder = Olmapi.GetDefaultFolder(olFolderInbox)

    Would i define olFolderInbox first eg olFolderInbox = "Another Folder"

    Cheers,

    Pete

  2. #2
    Join Date
    Feb 2004
    Location
    Dorset UK
    Posts
    147
    Just so I understand, you want to know every folder in your Outlook ?

    Or

    Did you want to check all the folders to find a specific email ?

    Or

    Did you just want to look through a specific folder ?


    ~Ken

  3. #3
    Join Date
    Feb 2004
    Location
    Dorset UK
    Posts
    147

    Lightbulb

    Ok, heres a way of get the names of every folder in your Outlook.

    Note; folder 1 (wspc.folders(1)) is my main outlook, I have access to more than 1 account, you may have to alter this, or you could create another nested loop around this.

    Now you have every name of each folder, you can perform other searchs, like every item (email) in every folder..

    Hope this helps..If not, let me know more...

    ~Ken


    Sub Petes_Solution1()

    Set OLook = CreateObject("Outlook.Application")
    Set Wspc = OLook.GetNamespace("MAPI")

    '
    ' Folder 1 is my inbox, this might differ for yourself
    '

    For Second_Folder = 1 To Wspc.folders(1).folders.Count

    Debug.Print Wspc.folders(1).folders(Second_Folder)

    Next


    End Sub

Posting Permissions

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