Run time error '-2147352567 (80020009)'

C

Carol Geddes

I get the runtime error and it says "Array index out of bounds"
On the second line of code below.

Set nms = Outlook.GetNamespace("Mapi")
Set fld = nms.Folders(olFolderContacts).Folders("ModifiedContact")

Originally I had in the second line.
Set fld = nms.GetDefaultFolder(olFolderContacts)
This worked but I wish to go to a custom folder now.

Any idea what am I doing wrong?
I find the help quite difficult to use in Outlook 2000.

Thanks, (newbie)
Carol
 
D

Dmitry Streblechenko \(MVP\)

Pass the name of the folder instead of olFolderContacts. Note that in case
of a child folder, you'd need to use this repeatedly to drill down the
hierarchy:

fld = nms.Folders("Parent Folder").Folders("ModifiedContact")


Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
C

Carol Geddes

Thank you
Dmitry Streblechenko (MVP) said:
Pass the name of the folder instead of olFolderContacts. Note that in case
of a child folder, you'd need to use this repeatedly to drill down the
hierarchy:

fld = nms.Folders("Parent Folder").Folders("ModifiedContact")


Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top