Rodemberry
Member
- Outlook version
- Outlook 2010 64 bit
- Email Account
- Exchange Server
Exchange Server 2010, OL 2010.
Been using this VB code for months to access a custom contacts folder called "clients". Suddenly yesterday it stopped working.
Set MySession = GetObject(, "Outlook.application")
Set myNS = MySession.GetNamespace("MAPI")
Set MyFolder = myNS.folders(2).folders("Clients")
Set myitems = MyFolder.items
I got it working again by changing myNS.folders(2).folders("Clients") to myNS.folders(1).folders("Clients")
1. Can you shed some light on why this may have changed?
2. Is there a better, more general way to point to this folder that would address a change in the future?
Thanks
Been using this VB code for months to access a custom contacts folder called "clients". Suddenly yesterday it stopped working.
Set MySession = GetObject(, "Outlook.application")
Set myNS = MySession.GetNamespace("MAPI")
Set MyFolder = myNS.folders(2).folders("Clients")
Set myitems = MyFolder.items
I got it working again by changing myNS.folders(2).folders("Clients") to myNS.folders(1).folders("Clients")
1. Can you shed some light on why this may have changed?
2. Is there a better, more general way to point to this folder that would address a change in the future?
Thanks