D
deko
Can I open an Access database from the Outlook Calendar Appointment form
using a macro?
For example, when a user opens an existing Appointment Item from the Outlook
Calendar, there is a button I've placed on the toolbar of the Appointment
form that launches the below macro (mostly pseudo code).
As you will see from my pseudo code, I want to open Access and pass the
value from the Appointment Item's Location field to MyDatabase.mdb, which
will result in the database displaying the corresponding record for that
location. Can this be done with a macro?
Thanks in advance and Merry Christmas!
[macro code for button on Appointment form]
Public Sub OXP()
'Required reference: Microsoft Access 11.0 Object Library
On Error GoTo HandleErr
'Dim appt As AppointmentItem
'Set appt = AppointmentItem
'Debug.Print Location.Value
Debug.Print Item.Location '???
'Dim acapp As Access.Application
'Set acapp = GetObject(, "Access.Application")
'acapp.Visible = True
'how to open database: C:\My Documents\MyDatabase.mdb ?
'how to pass location value to Access?
Exit_Here:
On Error Resume Next
Set acapp = Nothing
Exit Sub
HandleErr:
Select Case Err.Number
Case 429
Set acapp = New Access.Application
Resume Next
Case Else
Debug.Print "Error Number " & Err.Number & ": " &
Err.Description
End Select
End Sub
using a macro?
For example, when a user opens an existing Appointment Item from the Outlook
Calendar, there is a button I've placed on the toolbar of the Appointment
form that launches the below macro (mostly pseudo code).
As you will see from my pseudo code, I want to open Access and pass the
value from the Appointment Item's Location field to MyDatabase.mdb, which
will result in the database displaying the corresponding record for that
location. Can this be done with a macro?
Thanks in advance and Merry Christmas!
[macro code for button on Appointment form]
Public Sub OXP()
'Required reference: Microsoft Access 11.0 Object Library
On Error GoTo HandleErr
'Dim appt As AppointmentItem
'Set appt = AppointmentItem
'Debug.Print Location.Value
Debug.Print Item.Location '???
'Dim acapp As Access.Application
'Set acapp = GetObject(, "Access.Application")
'acapp.Visible = True
'how to open database: C:\My Documents\MyDatabase.mdb ?
'how to pass location value to Access?
Exit_Here:
On Error Resume Next
Set acapp = Nothing
Exit Sub
HandleErr:
Select Case Err.Number
Case 429
Set acapp = New Access.Application
Resume Next
Case Else
Debug.Print "Error Number " & Err.Number & ": " &
Err.Description
End Select
End Sub