M
mmattson
I am using Access 2003, Outlook 2003, Exchange 2003
I am developing a simple Access CRM for our office. The DB uses a linked
connection to Outlook/Public Folders/Address Book to populate the contacts
table.
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
**************************
I have also tried this code where I have gotten the ID for the Address Book
I want to use:
**************************
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("000000
001A447390AA6611CD9BC800AA002FC45A030082A9113B53F5
E344B7226F2A7489F43100000009A8BD0000")
Set MyItem = olapp.CreateItem(olContactItem)
MyItem.Display
Set olfolder = Nothing
Set olapp = Nothing
End Sub
*****************
This code also only opens the Personal Contacts form. Please advise on how
to open a Public Folders/Address Book contact form.
I am developing a simple Access CRM for our office. The DB uses a linked
connection to Outlook/Public Folders/Address Book to populate the contacts
table.
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
**************************
I have also tried this code where I have gotten the ID for the Address Book
I want to use:
**************************
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("000000
001A447390AA6611CD9BC800AA002FC45A030082A9113B53F5
E344B7226F2A7489F43100000009A8BD0000")
Set MyItem = olapp.CreateItem(olContactItem)
MyItem.Display
Set olfolder = Nothing
Set olapp = Nothing
End Sub
*****************
This code also only opens the Personal Contacts form. Please advise on how
to open a Public Folders/Address Book contact form.