Access Folders via OLE

  • Thread starter Thread starter LCermak
  • Start date Start date
L

LCermak

I am trying to use OLE to access the calendar folders in Outlook. It
works fine for the default calendar and for subfolders I create under
"My Calendars". However if I open a .PST file (File/Open/Outlook Data
File) I cannot access that folder. I do not see it in a list. What do
I need to do from the code to do this? Below is the code I am using.

lole_outlook.ConnectToObject("", "outlook.Application")
lole_namespace = lole_outlook.GetNameSpace("MAPI")
lole_items=
lole_namespace.GetDefaultFolder(9).Folders("sub1").Items

This causes an error. I have tried numerous ways to access the
subfolders without success. I have also tried getting a list of
available folders and it does not appear in the list.

Any suggestions, code examples, ect?
Thanks...

Larry Cermak
Branick Consulting, Inc.
www.branick-inc.com
 
Back
Top