Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem accessing user-defined fields in Exchange w/ MAPI

Status
Not open for further replies.

sternaphile

Programmer
Jul 8, 2004
4
US
We recently upgraded to Exchange Server 2003. Some time after that, there was a need to create some new user-defined fields to a couple of the Exchange folders. This was done from the Outlook interface. Now, we have a legacy Access app that connects to Exchange via MAPI and retrieves some contact info into an Access mdb. The problem is that these new fields, though they are visibler thru Outlook, are not present from the MAPI connection. How do we make these visible to the Access side from Exchange?

I have included a snippet of code to show you how we are retrieving the Exchange data thru Access.
.
.
.
Dim colItems As Items
Dim tblContacts As Recordset
Dim objItem As Outlook.ContactItem
Dim strMessage As String
Dim strSQL As String
On Error GoTo ERR_ExportContactsFolder
DoCmd.Hourglass True
' This part will do the primary contacts
strSQL = "DELETE Contacts.* FROM Contacts;"
DoCmd.RunSQL strSQL
Set tblContacts = CurrentDb.OpenRecordset("Contacts")

Set colItems = objapp.GetNamespace("MAPI").Folders.Item("Public Folders"). _
Folders.Item("All Public Folders"). _
Folders.Item("FHLBC"). _
Folders.Item("Bank Contact Information"). _
Folders.Item("Contact Management").Items

Set objItem = colItems.GetFirst
Do While Not objItem Is Nothing
tblContacts.AddNew
With objItem

' Get existing field
tblContacts![Customer Number] = .UserProperties("CustomerNo")
' Get existing field
tblContacts!Company = .CompanyName
.
.
.
' Get new field - this fails
tblContacts!ContactUID = .ContactUID
' Get new field - this fails
tblContacts!MPFContact = .MPFContact
.
.
. tblContacts.Update

End With
Set objItem = colItems.GetNext
DoEvents


.
.
.

Any help/advice would be greatly appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top