Discussion Locked

Dynamic MAPILEVEL link to MS Access

0 helpful
0 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I'm trying to create a dynamic link to any Exchange Calendar through an Access database. This way, no matter which user accesses the database, there would be a link to their own calendar. I've found many examples of the code required to link to the Calendar folder, however, each example "hardcodes" the MAPILEVEL to the exchange mailbox.

The code that has worked best so far is:

Function AttachCalendar()
Dim db As DAO.Database
Dim td As DAO.TableDef
On Error GoTo Errorhandler Set db = CurrentDb()
Set td = db.CreateTableDef("tblCalendar")
td.Connect = "Exchange 4.0;MAPILEVEL=Mailbox - |;"
td.Connect = td.Connect & "DATABASE=\.mdb;"
td.Connect = td.Connect & "PROFILE="
td.SourceTableName = "Calendar"
db.TableDefs.Append td
Application.RefreshDatabaseWindow
MsgBox "Table Appended!"
Exit Function
Errorhandler:
MsgBox "Error " & Err & " " & Error
Exit Function
End Function

My question is; is there a global symbol or variable that can be used for the MAPILEVEL qualifier? The PROFILE and DATABASE variables can be "hardcoded" but it would be nice if there was a way to dynamically replace the MAPILEVEL variable.

0 replies

No replies were posted before this discussion closed.

This discussion is closed to new replies.