Search folder

S

Semut

Hello,

How do i know if a selected MAPIFolder is a folder of the search folders
through programatically?


thanks
 
S

Sue Mosher [MVP-Outlook]

Try to get its Folders collection. It won't have one:

On Error Resume Next
Set colFolders = mySearchFolder.Folders
If Err <> 0 Then
' mySearchFolder is a search folder
End If
 
K

Ken Slovak - [MVP - Outlook]

I don't know how to tell that using Outlook object model code, but using CDO
1.21 or Extended MAPI or Redemption (www.dimastr.com/redemption) you could
look at PR_FOLDER_TYPE (0x36010003) and if the value is 2 (FOLDER_SEARCH)
you have a search folder. A normal folder is 1 (FOLDER_GENERIC).
 
S

Semut

thanks

Ken Slovak - said:
I don't know how to tell that using Outlook object model code, but using
CDO 1.21 or Extended MAPI or Redemption (www.dimastr.com/redemption) you
could look at PR_FOLDER_TYPE (0x36010003) and if the value is 2
(FOLDER_SEARCH) you have a search folder. A normal folder is 1
(FOLDER_GENERIC).
 
S

Semut

thanks

Try to get its Folders collection. It won't have one:

On Error Resume Next
Set colFolders = mySearchFolder.Folders
If Err <> 0 Then
' mySearchFolder is a search folder
End If
 
K

Ken Slovak - [MVP - Outlook]

Hey, nice trick, Sue. I always check it using a MAPI property but this does
it in the OOM. Cool.




Try to get its Folders collection. It won't have one:

On Error Resume Next
Set colFolders = mySearchFolder.Folders
If Err <> 0 Then
' mySearchFolder is a search folder
End If
 

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