Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to retrieve mail from the inbox vis Extra!Basic

Status
Not open for further replies.

Holly888

Programmer
Dec 3, 2008
10
CA
I could open folders in outlook by using the following code :

Set thisApp = CreateObject("Outlook.Application")
Set thisNameSpace = thisApp.GetNamespace("MAPI")
Set thisFolder = thisNameSpace.Folders("Personal Folders")
Set theseItems = thisFolder.Items

these code doesn't work for Inbox. Do you know how to retrieve mail from Inbox?
 
Hi,

Within your Personal Folder are other Folders. Maybe like...
Code:
Set ThisFolder = ThisFolder.Folders("Inbox")


Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Hi SkipVought,
It didn't work!The Inbox is not within the personal folders. Under the Mailbox, there's subfolder for calender , sent items and inbox. I could create mail item using CreateItem(olmailitem) function. Now I am looking some way to retrieve mail from Inbox.
 
Code:
 Set thisFolder = thisNameSpace.Folders(olFolderInbox)
 
I find the solution myself. Thanks anyway!
 
Please post your solution, as it will benefit other Tek-Tip members.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
The solution is:

Set thisApp = CreateObject("Outlook.Application")
Set thisNameSpace = thisApp.GetNamespace("MAPI")
Set thisFolder = thisNameSpace.Folders("Mailbox- lastname, first name")
Set thisFolder = thisFolder.Folders("Inbox")
Set theseItems = thisFolder.Items

Please note that the Inbox is a subfolder under "Mailbox - last name, First Name" in outlook.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top