Re: Checking type of a MAPIFolder



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.

--
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 Alvarez Doval" <pablod@xxxxxxxxxxxxxxxxx> wrote in message news:08857381-B9C3-467F-84E0-8417EF9F6A2F@xxxxxxxxxxxxxxxx
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

"Pablo Alvarez Doval" <pablod@xxxxxxxxxxxxxxxxx> wrote in message news:3F091C38-20CE-40C1-90D3-9234AB432F07@xxxxxxxxxxxxxxxx
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

"Ken Slovak - [MVP - Outlook]" <kenslovak@xxxxxxxx> wrote in message news:%23H6bDaIbHHA.5044@xxxxxxxxxxxxxxxxxxxxxxx
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.

--
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 Alvarez Doval" <pablod@xxxxxxxxxxxxxxxxx> wrote in message news:B4F98310-0930-41C8-9BE4-DD3F44432072@xxxxxxxxxxxxxxxx
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




.



Relevant Pages

  • Re: Outlook displays two identical Personal Folders
    ... Create a new mail profile and point it to reuse your current active .pst ... Milly Staples [MVP - Outlook] ... ||| Folder in the folder list. ...
    (microsoft.public.outlook.installation)
  • Re: Problems importing/recovering old PST
    ... There is no folder named documents. ... What is the "profile" and what directories and files are part of it? ... I do not see what harm renaming a pst file would cause. ... As far as your Outlook profile is concerned, ...
    (microsoft.public.outlook.installation)
  • Re: Looking for my Message Store
    ... MS-MVP Outlook Express ... YES, I've copied my message store to my external HD, deleted my new identity, downloaded and installed OEQB, rebooted and when I look at File> Identities, just the main identity is shown, however, when I browse to the store, I still see the GUID, and Microsoft and Outlook Express folders associated with the new identity. ... and the OE folder there contains the store also, although it is not quite as large a file as the OE file in the old identity. ... the dbx files I put into it?" ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: problems reconnect old data file .pst
    ... Also as Brian Tillman ... If you copy another PST ... You installed Outlook on a new computer or a new hard disk and are ready ... Although you can keep your data files in any folder, ...
    (microsoft.public.outlook.installation)
  • Re: FAO Brain Re: Wanting to sort out my PST files
    ... having struggled for years to find out how to backup my Outlook ... I move my emails out of inbox into folders ... whichever PST you have selected in the "Delivery new e-mail ... put all family emails in a folder with a display name family? ...
    (microsoft.public.outlook.general)

Loading