Refering to Inbox subfolders in VB
Posted on 2003-03-05
I currently have a program that checks Outlook 2000 every 60 seconds for new emails that have Attachments with a specific naming convention, when found the Attachment is copied to an external directory for pickup by a Mainframe program. The actioned email is then moved to a subfolder of Inbox, in Outlook 2000. Currently there is only 1 subfolder so I can get away with refering to this subfolder as follows:
Set oSubFolder = oFolder.Folders.Item(1)
Thus using oSubFolder whenever I mean the subfolder.
My challenge: they want to add ~50 new subfolders now and some more later.
My Question: Is there a way to refer to a subfolder by name rather than by item number, as the relative position of subfolders is probably going to change with each set of additions and probably deletions.