-
-
Hi and welcome to VBAX
First, I should point out that you don't need the quotes unless you're referring to a folder's name - olFolderInbox is a VBA constant.
But that also kind of answers your question, since you can refer to the namespace's folders collection and select the item by name:[VBA]Dim ns As Outlook.NameSpace
Dim ib As MAPIFolder
Dim TargetFolder1 As MAPIFolder
Dim TargetFolder2 As MAPIFolder
Dim TargetFolder3 As MAPIFolder
'set the namespace
Set ns = Application.GetNamespace("MAPI")
'set your inbox
Set ib = ns.GetDefaultFolder(olFolderInbox)
'set your target folder
Set TargetFolder1 = ns.Folders.Item("1P396")
Set TargetFolder2 = ns.Folders.Item("BREC-General")
'you may need to driil down some levels
Set TargetFolder3 = ns.Folders.Item("1P396").Folders.Item("A Sub Folder of 1P396")[/VBA] Hope that helps
K :-)
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules