Quote:
Originally Posted by megatronixs
Is the below code counting from the top of the email box? (so 6 would be the inbox)?
|
No!
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