![]() |
|
|
|
#1
|
|||
|
|||
|
Hi Gmayor,
Is the below code counting from the top of the email box? (so 6 would be the inbox)? Code:
Set Inbox = OlApp.GetNamespace("Mapi").GetDefaultFolder(6) 'Inbox
Greetings. |
|
#2
|
||||
|
||||
|
Quote:
6 is the numeric equivalent of the default inbox. You can access any of the folders from VBA e.g. to get the Inbox folder for a separate Account called 'Account Name' Code:
Dim oFolder As Folder
Dim oFldr As Folder
Dim olNS As NameSpace
Set olNS = Application.GetNamespace("Mapi")
For Each oFolder In olNS.folders
'MsgBox oFolder.Name
If oFolder.Name = "AccountName" Then
Set oFldr = oFolder.folders("Inbox")
End If
Next oFolder
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to synchronize emails in certain folders when upgrade Outlook 2010 to Outlook 201 | davip | Outlook | 0 | 07-30-2013 09:07 PM |
| Moving emails in shared mailbox to personal mailbox | hlock | Outlook | 0 | 12-12-2012 02:32 PM |
| Outlook 2010 & Mailbox Access | Stkitts11 | Outlook | 0 | 04-10-2012 06:48 AM |
Merging outlook folders and emails
|
rudihorvath | Outlook | 1 | 03-16-2012 07:03 AM |
Outlook 07 Not Fetching Emails in Random folders
|
miccguido | Outlook | 1 | 02-14-2012 01:51 PM |