Creating address book from Access

  • Thread starter Thread starter Phil Stanton
  • Start date Start date
P

Phil Stanton

I am trying to create an address book from MS Access.from a yacht club
database using vb code.

Programatically I can add a subfolder to Contacts (Address book) called
"Yacht Club". I can add contacts and emails without trouble, but they add
into the "Contacts" folder instad of the "Yacht Club" folder.

How do I force the additions to be in the required folder?

Thanks,

Phil
 
To create a new item in a non-default folder programmatically, use the Add method on the target folder's Items collection:

Set newItem = targetFolder.Items.Add("IPM.Post.YourFormName")

The message class parameter is optional.

To create an item in another person's mailbox, use Namespace.GetSharedDefaultFolder to get the target MAPIFolder. Otherwise, you can use the code at http://www.outlookcode.com/d/code/getfolder.htm to walk the folder hierarchy and return the MAPIFolder corresponding to a given path string.

FYI, there is a newsgroup specifically for general Outlook programming issues "down the hall" at microsoft.public.outlook.program_vba or, via web interface, at http://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public.outlook.program_vba

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Back
Top