Results 1 to 2 of 2

Thread: Folders in Outlook

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2003
    Posts
    1

    Folders in Outlook

    Hello, what is the way to access public folders in Outlook?
    I tried this:


    Dim dosContacts As Outlook.MAPIFolder
    Set dosContacts = Application.GetNamespace("MAPI").GetDefaultFolder(olPublicFoldersAllPublicFolders)

    but it says it's waiting for an object...
    In fact, the folder I want to access is in Public Folders\All Public Folders\ and is called Public Contacts.

    So how can I access the items (which are contacts) in this folder in VBA???

  2. #2
    Addicted Member
    Join Date
    Aug 2003
    Location
    Singapore
    Posts
    245

    Lightbulb May i comment

    May be this helps...
    VB Code:
    1. Dim dosNameSpace As Outlook.NameSpace
    2. Dim dosPublics As MAPIFolder
    3. Dim dosContacts As MAPIFolder
    4. Set dosNameSpace = Application.GetNameSpace("MAPI")
    5. Set dosPublics = _
    6.     dosNameSpace.GetDefaultFolder(olFolderXXXX) 'should be the public
    7. Set dosContacts = dosPublics.Folders("All Public Folders")
    8. 'The following Visual Basic for Applications example returns
    9. the first folder in myFolder.
    10. Set dosContacts = dosPublics.Folders(1) 'u can use the name..
    I may have interpret your post wrongly
    Correct me if I made a mistake...
    Hope This Helps.. .....Enjoy Coding.....//


    zak2zak

Posting Permissions

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



Click Here to Expand Forum to Full Width