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
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