|
-
Nov 23rd, 2000, 11:31 AM
#1
Thread Starter
Member
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.
-
Nov 24th, 2000, 04:16 AM
#2
Thread Starter
Member
No Ideas?
Can nobody help me with this?
Life is trip, eat it and smile.
-
Nov 24th, 2000, 04:59 AM
#3
Lively Member
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.
-
Nov 24th, 2000, 06:14 AM
#4
Thread Starter
Member
Perfect
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|