Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / VS Tools for Office / March 2007

Tip: Looking for answers? Try searching our database.

Checking type of a MAPIFolder

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Pablo Alvarez Doval - 22 Mar 2007 12:11 GMT
Hi all,

   I'm trying to iterate thru all the MAPIFolders in my personal store and
get the contacts one. How could I get the 'type' of a folder (say if it is a
contacts folder, or an inbox, etc...)? Thanks a lot!

Best Regards!
Pablo
Ken Slovak - [MVP - Outlook] - 22 Mar 2007 14:32 GMT
MAPIFolder.DefaultItemType. It returns a 32-bit int that's a member of the
OlItemType enum, for contacts you're looking for olContactItem which has a
value of 2.

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

> Hi all,
>
[quoted text clipped - 4 lines]
> Best Regards!
> Pablo
Pablo Alvarez Doval - 23 Mar 2007 04:54 GMT
Thanks, in the end it ws a syntax problem.. I'm having some quite silly days
lately :P thanks!

By the way.. I've created a new .pst with a contacts folder there, but when
I create a new contact like this...

MSOutlook.ContactItem contact = null;
contact =
(MSOutlook.ContactItem)Globals.GRAAddIn.Application.CreateItem(MSOutlook.OlItemType.olContactItem);

... I get the contact added to the contacts folder on the original .pst...
is the a way to change this, or to change the default contacts folder?

Thanks a lot!
Pablo

> MAPIFolder.DefaultItemType. It returns a 32-bit int that's a member of the
> OlItemType enum, for contacts you're looking for olContactItem which has a
[quoted text clipped - 8 lines]
>> Best Regards!
>> Pablo
Pablo Alvarez Doval - 23 Mar 2007 05:42 GMT
Answering to myself...

I've just added the item manually to the items collecion like this:
contact =
(MSOutlook.ContactItem)defaultContactFolder.Items.Add(MSOutlook.OlItemType.olContactItem);

Anyway, I'm still interested in knowing if I can change the default contacts
folder, for example, to a new folder or a folder in a different store.

Cheers!
Pablo

> Thanks, in the end it ws a syntax problem.. I'm having some quite silly
> days lately :P thanks!
[quoted text clipped - 24 lines]
>>> Best Regards!
>>> Pablo
Ken Slovak - [MVP - Outlook] - 23 Mar 2007 14:38 GMT
Using CreateItem will always create the item in the default folder for that
type of item. Each store (PST) has a set of default folders, such as
Contacts. You cannot change the default Contacts folder for a store and only
1 store can be the default, where you get your email delivered. The only way
to change that is to change the store your Outlook profile uses. All of that
has to be done in the UI, not in code.

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

> Answering to myself...
>
[quoted text clipped - 38 lines]
>>>> Best Regards!
>>>> Pablo
Rafael - 23 Mar 2007 16:40 GMT
Pablo,

Are you looking to create a contact on a different folder like "MY Contacts
Folder"?

I believe this can be done by setting the current folder as you custom
contacts folder and then adding an item to it directly or from a contact
form template.

Rafael

> Answering to myself...
>
[quoted text clipped - 38 lines]
>>>> Best Regards!
>>>> Pablo
Ken Slovak - [MVP - Outlook] - 25 Mar 2007 21:51 GMT
You don't need to change the current folder, just add an item to the Items
collection of whatever folder you want.

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

> Pablo,
>
[quoted text clipped - 6 lines]
>
> Rafael

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
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.