Results 1 to 4 of 4

Thread: Reading Mail in Outlook from specific folder

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2000
    Location
    Vienna, Austria
    Posts
    62

    Arrow

    Now I found out how to read mails from outlook, but only from the default inbox folder. How can I read from another folder?
    ....
    Set objNS = objOL.GetNamespace("MAPI")

    'get inbox
    Set objFolder = objNS.GetDefaultFolder(olFolderInbox)

    'loop thru inbox, display items
    ....
    Any input?
    Life is trip, eat it and smile.

  2. #2

    Thread Starter
    Member
    Join Date
    Nov 2000
    Location
    Vienna, Austria
    Posts
    62

    Angry No Ideas?

    Can nobody help me with this?
    Life is trip, eat it and smile.

  3. #3
    Lively Member Ishamel's Avatar
    Join Date
    Nov 1999
    Location
    Edinburgh, Scotland
    Posts
    112
    These constants will allow you to read items from the standard Outlook folders.

    olFolderDeletedItems
    olFolderOutbox
    olFolderSentMail
    olFolderInbox
    olFolderCalendar
    olFolderContacts
    olFolderJournal
    olFolderNotes
    olFolderTasks

    The following examples should give you an idea on how to point to 'user created' folders and access their mail items.

    Example 1
    Code:
    Set myOLApp = CreateObject("Outlook.Application")    
    Set myNameSpace = myOLApp.GetNamespace("MAPI")
    Set myInbox = myNameSpace.GetDefaultFolder(olFolderInbox)
    Set myMiscFolder = myInbox.Folders("Misc")
    Set myItem = myMiscFolder.Items(1)
    Text1.Text = myItem.Body
    Example 2
    Code:
    Set myOLApp = CreateObject("Outlook.Application")    
    Set myNameSpace = myOLApp.GetNamespace("MAPI")
    Set myPubFold = myNameSpace.Folders("Public Folders")
    Set myFolder1 = myPubFold.Folders("Folder 1")
    Set myFolder2 = Folder1.Folders("Folder 2")
    Set myFolder3 = Folder2.Folders("Folder 3")
    Set myItem = Folder3.Items(4)
    Text1.Text = myItem.Body
    Hope this helps.

  4. #4

    Thread Starter
    Member
    Join Date
    Nov 2000
    Location
    Vienna, Austria
    Posts
    62

    Smile Perfect

    Great!!! Many thanks.
    Life is trip, eat it and smile.

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