S
shanej2015 at yahoo dot com
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
What's really remarkable is that when I Google "3276 "Invalid
database object reference."" Nothing is returned, not even from
Microsoft...not even in their Knowledgebase. How amazing is that?
Shane
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
What's really remarkable is that when I Google "3276 "Invalid
database object reference."" Nothing is returned, not even from
Microsoft...not even in their Knowledgebase. How amazing is that?
Shane