Linked (shared) calendar to Access DB

  • Thread starter Thread starter soundneedle
  • Start date Start date
S

soundneedle

OL2003 (Exchange), Access 2003

I know how to create a linked table to Outlook using Access, but how do
you created a linked table to a shared Outlook calendar? When I try
using the wizard I get this error:

The MAPI store 'Calendar' is known but is not available in the current
profile. This can occur if you use a profile that is designed for
working offline from a server and try to link to a folder or address
book on the server. The wizard is unable to link to it.

I have my profile open, which has a view of a shared calendar on a
different user's profile. Any suggestion on how to create a linked
table to this shared profile's calendar?
 
I found this code on Microsoft, but can't figure out how to make it
work for appointments/calendar instead of the inbox (folder).


Option Compare Database
Option Explicit

Function AttachMail()

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'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("tblInbox")

'Within the following line, replace <mailbox name> with the actual
'Exchange mailbox name created on your computer. For example:
' Nancy Davolio
td.Connect = "Exchange 4.0;MAPILEVEL=Mailbox - <mailbox name>|;"

'Within the following line, replace <drive\path\dbname> with the
'actual path to the database. For example:
' C:\Program Files\Microsoft Office\Office\Samples\Northwind.mdb
'This will also support UNC (for example,
\\servername\share\dbname).
td.Connect = td.Connect & "DATABASE=<drive\path\dbname>;"

'Within the following line, replace <profile name> with the actual
'name of your email profile created on your computer. For example:
' Microsoft Outlook
td.Connect = td.Connect & "PROFILE=<profile name>"

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

db.TableDefs.Append td

Application.RefreshDatabaseWindow

MsgBox "Table Appended!"

Exit Function

Errorhandler:
MsgBox "Error " & Err & " " & Error
Exit Function
End Function
 
You can only link to folders that are visible in your Folder List, not to those that you open with File | Open | Other User's Folder.
 
Back
Top