Solved

outlook access added mail box under personal folder

Posted on 2013-12-07
2
292 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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
Read this checklist to learn more about the 15 things you should never include in an email signature.
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 …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

685 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