Check if folder is public - Outlook COM Add-In, Exchange Server

  • Thread starter Ricardo Pereira
  • Start date
R

Ricardo Pereira

Hello everybody.

I need a little help here:
I have a COM AddIn for Outlook 2000, using Exchange server 2000, that
needs to check if an email's folder is public or is not.

So, my 2 questions are:
1 - How do I get a folder reference of an email (which is on that
folder), just by having a reference to a mailItem?

2 - After getting the email's folder, how can I check if this is a
public folder or not?

The reason for the 2nd question is that my AddIn only works well on
emails that are in the user's exchange mailbox, but if they are in an
exchange's server public folder, the AddIn won't work well. So I
decided that I would move the email from the public folder (if that's
the case) to the user's inbox, make the addin do its job and move back
the email to its original folder. But I would only do this if the
email was checked to be in a public folder.

Thanks in advance for all the help

Ricardo Pereira
 
N

Nadya

Ricardo,

If you have the EntryID (PR_ENTRYID) of a message, you can have the EntryID
of his parent. This is saved in PR_PARENT_ENTRYID property of the message.

HTH
 
S

Sue Mosher [MVP]

1) One method is to walk up the folder hierarchy using the Parent property
that Nadya mentioned. But since you are interested only in the mailbox
folders, you might also check the folder's StoreID and compare it with the
StoreID for the user's Inbox.
 
R

Ricardo Pereira

Hello again, and thanks for your answers. Your answers seem to solve
the situation as I described, the problem is that I am either using
the Outlook Object Model or CDO (Visual Basic), and the properties you
told me to use (PR_PARENT_ENTRYID and PR_ENTRYID) don't seem to be
accessible through the OOM or CDO, but through C++ in Extended MAPI.
Is this so?

How can I, using the OOM or CDO, get to do what I need to? I forgot to
mention earlier but I am using VB 6.0 to write the COM Add-In.

Thanks again
 
K

Ken Slovak - [MVP - Outlook]

In CDO PR_ENTRYID is Message.ID and PR_PARENT_ENTRYID is
Message.Parent.ID or you can use the Folder where the Message is and
use Folder.ID.

If you are working with CDO you should look at
www.cdolive.com/cdo10.htm and www.cdolive.com/cdo5.htm for information
on CDO property tags and code examples. You also might want to
consider downloading OutlookSpy from www.dimastr.com which can let you
look at all the MAPI properties for items, folders, stores and so on.
 
R

Ricardo Pereira

Thank you for your help Ken, I believe this will do the trick.

Thanks again

Ricardo Pereira
 

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