Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming Add-Ins / November 2005

Tip: Looking for answers? Try searching our database.

Outlook Folder Object Types

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dave - 16 Nov 2005 23:30 GMT
Looking at the example below, how would I put some code in here to know that
a folder is specifically a folder containing outlook contacts ?

           Dim ofldrs As Outlook.Folders
           Dim ffldrs As Outlook.MAPIFolder
           Set ofldrs = g_fldr.Folders
           Set ffldrs = ofldrs.GetFirst()
           Do While Not ffldrs Is Nothing
               ' put something here to check the type -
               Set ffldrs = ofldrs.GetNext()
           Loop

I know to look at the Class and it will tell me the object is a folder
(olFolder) or at the Class and know it is a contact (olContact)  but how do
I know a folder is a Contact Folder, like Outlook 2003 does ?
Ken Slovak - [MVP - Outlook] - 17 Nov 2005 15:05 GMT
Look at DefaultItemType, it will be olContactItem for a contacts folder.
Outlook 2003 also has a DefaultMessageClass property, a substring search on
that would look for "IPM.Contact" for a contacts folder. But DefaultItemType
will work will all Outlook versions.

Signature

Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm

> Looking at the example below, how would I put some code in here to know
> that
[quoted text clipped - 13 lines]
> do
> I know a folder is a Contact Folder, like Outlook 2003 does ?
Dave - 17 Nov 2005 16:08 GMT
How do I get the Personal Folders root folder object ?  Outlook 2003 because
of how it is setup, users are now creating contact folders all over the
place, which is requiring me to look for the contact folders where ever they
might be.  The problem is I don't know how to retrieve the root folder
object to start searching through.

What a mess :(

> Look at DefaultItemType, it will be olContactItem for a contacts folder.
> Outlook 2003 also has a DefaultMessageClass property, a substring search on
[quoted text clipped - 18 lines]
> > do
> > I know a folder is a Contact Folder, like Outlook 2003 does ?
Ken Slovak - [MVP - Outlook] - 17 Nov 2005 21:52 GMT
You can't get at the RootFolder (in MAPI terms) using the Outlook object
model. You can get to Top of Information Store, which is what I think you
meant (the Outlook Today folder). NameSpace.Folders gives you the Top of
Store for each store opened by the user. For an easy way to get there for
the default store:

Set oFolder = oNS.GetDefaultFolder(olFolderInbox).Parent

That's the Top of Store folder and if you get that folder's Folders
collection you can iterate it to check for any Contacts folders.

Signature

Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm

> How do I get the Personal Folders root folder object ?  Outlook 2003
> because
[quoted text clipped - 5 lines]
>
> What a mess :(
Dave - 17 Nov 2005 22:32 GMT
Wouldn't this give me the top too ?

           Set ofldrs = g_ns.Folders("Personal Folders").Folders

or is your way better ?

> You can't get at the RootFolder (in MAPI terms) using the Outlook object
> model. You can get to Top of Information Store, which is what I think you
[quoted text clipped - 16 lines]
> >
> > What a mess :(
Ken Slovak - [MVP - Outlook] - 18 Nov 2005 14:05 GMT
It would if it was always called "Personal Folders". You can't always rely
on that. The way I mentioned will always work, even in non-English language
installations.

Signature

Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm

> Wouldn't this give me the top too ?
>
>            Set ofldrs = g_ns.Folders("Personal Folders").Folders
>
> or is your way better ?
Dave - 18 Nov 2005 14:43 GMT
Thanks, I will take your approach

> It would if it was always called "Personal Folders". You can't always rely
> on that. The way I mentioned will always work, even in non-English language
[quoted text clipped - 5 lines]
> >
> > or is your way better ?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.