Open 'New Contact' form from Access

Mmattson

Registered User.
Local time
Today, 16:20
Joined
Oct 28, 2002
Messages
46
I am using Access 2003, Outlook 2003, Exchange 2003

I am developing an Access CRM. The DB uses a linked connection to the Exchange server to populate the contacts table. The contact folder used is Address Book in Public Folders.

To create new contacts, it seems easiest to simply open a new contact form to add the new contact. When I use the following code, it opens a new contact form for my personal contacts folder. I need it to open a new contact form for the Public Folders Address book. HEre is the code I am using now:

Sub StartOutLook_click()
On Error GoTo StartOutLook_Error
Dim spObj As Object, MyItem As Object

' Create a Microsoft OutLook object.
Set spObj = CreateObject("Outlook.Application")

' Create and open new contact form for input.
Set MyItem = spObj.CreateItem(olContactItem)
MyItem.Display

' Quit Microsoft Outlook.
Set spObj = Nothing
Exit Sub

StartOutLook_Error:
MsgBox "Error: " & Err & " " & Error
Exit Sub
End Sub


If I need to point to a specific path to the Public Folders, please tell me how to find that path.

-Marcus
 
I have one update to add. I have found the path to my Address Book folder. I have modified my test code as follows but still open a personal contact form.

Private Sub PubFolderContact()
Dim olfolder As Outlook.mapiFolder
Dim olapp As Outlook.Application
Dim MyItem As Object
Set olapp = CreateObject("Outlook.Application")
Set olfolder = olapp.GetNamespace("Mapi").GetFolderFromID("000000001A447390AA6611CD9BC800AA002FC45A030082A9113B53F5E344B7226F2A7489F43100000009A8BD0000")
Set MyItem = olapp.CreateItem(olContactItem)
MyItem.Display

Set olfolder = Nothing
Set olapp = Nothing
End Sub
 

Users who are viewing this thread

Back
Top Bottom