Operation Failed, object could be not be found - Can't find the fo


G

Guest

Hi,

I am using outlook2003 and Exchange Server. I am trying to locate a calendar
name "*Education Calendar" in a public folder.

The path is "Public Folders\All Public Folders\EDUCATION\*Education
Calendar".

I've found the below script on Sue Mosher's site, but it can never find the
subfolder "EDUCATION". The object always returns "Nothing"... I don't know
why? Please help! I also tried in mixed case "Education". Same error.

Thanks


=============================================================
Dim objFolder As Outlook.MAPIFolder
Set objFolder = GetFolder("Public Folders/All Public
Folders/Education/*Education Calendar")

Public Function GetFolder(strFolderPath As String)As MAPIFolder
' folder path needs to be something like
' "Public Folders\All Public Folders\Company\Sales"
Dim objApp As Outlook.Application
Dim objNS As Outlook.NameSpace
Dim colFolders As Outlook.Folders
Dim objFolder As Outlook.MAPIFolder
Dim arrFolders() As String
Dim I As Long
On Error Resume Next

strFolderPath = Replace(strFolderPath, "/", "\")
arrFolders() = Split(strFolderPath, "\")
Set objApp = CreateObject("Outlook.Application")
Set objNS = objApp.GetNamespace("MAPI")
Set objFolder = objNS.Folders.Item(arrFolders(0))
If Not objFolder Is Nothing Then
For I = 1 To UBound(arrFolders)
Set colFolders = objFolder.Folders
Set objFolder = Nothing
Set objFolder = colFolders.Item(arrFolders(I))
If objFolder Is Nothing Then
Exit For
End If
Next
End If

Set GetFolder = objFolder
Set colFolders = Nothing
Set objNS = Nothing
Set objApp = Nothing
End Function


Isabelle
 
Ad

Advertisements

Ad

Advertisements

G

Guest

Hi,

This is a folder with notes. For some unknown reasons, it contains several
objects and files inside but "is NOT" a outlook folder. I got workaround, I
added the calendar to everyone's Favorites folder and access it from there
instead.

Thanks

AD
 

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