Solved

outlook access added mail box under personal folder

Posted on 2013-12-07
2
286 Views
Last Modified: 2013-12-22
have the below code that will roll through the inbox but need to access the added folder mail.abc.com
the code works for the inbox but need to cycle through the code in the mail.abc.com see image.
not sure of the syntax to change to access this folder
any help would be appreciated


Sub GetFromInbox()

    Dim olApp As Outlook.Application
    Dim olNs As NameSpace
    Dim Fldr As MAPIFolder
    Dim olMail As Variant
    Dim i As Integer

    Set olApp = New Outlook.Application
    Set olNs = olApp.GetNamespace("MAPI")
    Set Fldr = olNs.GetDefaultFolder(olFolderInbox)
 
    For Each olMail In Fldr.Items

       MsgBox olMail.Body
   
    Next olMail

    Set Fldr = Nothing
    Set olNs = Nothing
    Set olApp = Nothing

End Sub

pic
0
Comment
Question by:sydneyguy
2 Comments
 
LVL 20

Accepted Solution

by:
ltlbearand3 earned 500 total points
ID: 39703830
Not completely sure what folder you need to view in your email folders.  It sounds like you have an additional folder in mail.abc.com you want to access.  You could do that with some code like this:

    Dim Fldr2 As MAPIFolder
	Set Fldr2 = Outlook.Session.Folders("mail.abc.com").Folders("OtherSubFolder")

Open in new window


If you are wanting the inbox in the personal folders then you could do something like this:
    Dim Fldr2 As MAPIFolder
	Set Fldr2 = Outlook.Session.Folders("Personal Folders").Folders("OtherSubFolder")

Open in new window


There are many other ways to approach this, but I would need some clearer details to be able to help more.

-Bear
0
 

Author Closing Comment

by:sydneyguy
ID: 39735492
thanks for your help
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What does UTC stand for?  “Coordinated Universal Time” – Think of this as the true time on Planet Earth that never changes with the exception of minor leap seconds here and there to account for the changes in the planet's rotation.   What does th…
As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now