Public folders in Outlook 2000

  • Thread starter Thread starter Rick H
  • Start date Start date
R

Rick H

I use this code in my addin to reference items in a public folder
If the user is opening the folder that they have previously selected to
sync with I get grab a ref to the Items. This works fine in 2002(XP)
and 2003. But in 2000 I get an error when I reference
olPublicFoldersAllPublicFolders. I don't see this as a constant in
2000. Is there any way to work around this. Or is this a limtation in
2000, where you are unable to reference Public folders?

VB6 Code

ls_folders = Current folder selected
ls_cal_folder = "Some_public_folder"

If ls_folders = ls_cal_folder Then
If ll_cal_class = 18 Then
Set myFolder =
myNamespace.GetDefaultFolder(olPublicFoldersAllPublicFolders)
Set myOlItems = myFolder.Folders.Item("" + ls_cal_folder +
"").Items
Else
Set myFolder = myNamespace.GetDefaultFolder(olFolderCalendar)
Set myOlItems = Application.ActiveExplorer.CurrentFolder.Items
End If
 
As you have seen, that constant is not supported in versions earlier than Outlook 2002. In Outlook 2000, you must walk the folder hierarchy, starting with Namespace.Folders, to drill down into the Public Folders tree.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Back
Top