problem with code to link to an Outlook contacts folder

S

shanej

Hello,

I've been working on this for a while, and can't get it to work. I am
using Access and Outlook 2003. The following code give me "Error 3276
Invalid database object reference."

Function AttachContcts()

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'This code requires that the following object library be
referenced:
' Microsoft DAO 3.6 Object Library.

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim db As DAO.Database
Dim td As DAO.TableDef

On Error GoTo Errorhandler

Set db = CurrentDb()
Set td = db.CreateTableDef("newtable")

'Within the following line, replace <mailbox name> with the actual
'Exchange mailbox name created on your computer.
td.Connect = "Exchange 4.0;MAPILEVEL=Personal
Folders|Contacts;PROFILE=Yahoo;TABLETYPE=0;" _
& "DATABASE=" & db.Name

'Substitute the name of the email folder you wish to attach.
'In this example, we will attach the Inbox folder.
td.SourceTableName = "Media"

db.TableDefs.Append td

Application.RefreshDatabaseWindow

MsgBox "Table Appended!"

Exit Function

Errorhandler:
MsgBox "Error " & Err & " " & Error & " " & td.Connect

Exit Function
End Function
 
S

shanej

What's really remarkable is that when I Google "Error 3276 Invalid
database object reference." Nothing is returned, not even from
Microsoft...not even in their Knowledgebase. How amazing is that?

Shane
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top