Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Outlook calender entry to Ms Access 2002 table

Status
Not open for further replies.

neemi

Programmer
May 14, 2002
519
GB
I have written some code in access to be able to add a calender entry to outlook with a reminder. The details of this are also stored to an access table.

the code in access which writes to outlook is as follows:

Code:
Public Function SetOutlookReminder(vtApptDate As Variant, _
                                   vtApptTime As Variant, _
                                   strSubject As String, _
                                   strBody As String, _
                                   intRemMinsBeforeStart As Integer, _
                                   blnSetReminder As Boolean)
On Error GoTo ErrorHandler

'// =================================================================================
    Dim sMessage As String
    
    Dim objOutlook As Outlook.Application
    Dim objAppt As Outlook.AppointmentItem
    
    Set objOutlook = CreateObject("Outlook.Application")
    Set objAppt = objOutlook.CreateItem(olAppointmentItem)
    
    With objAppt
        .Start = vtApptDate & " " & vtApptTime
        .subject = strSubject
        .Body = strBody
        .ReminderMinutesBeforeStart = intRemMinsBeforeStart
        .ReminderSet = blnSetReminder
        .Save
        .close (olSave)
    End With
    
    Set objAppt = Nothing
    Set objOutlook = Nothing

Exit_ErrorHandler:
    Exit Function

ErrorHandler:
    MsgBox Err.Number & " - " & Err.Description, vbOKOnly + vbExclamation, "CLM Outlook Reminder Error"
    Resume Exit_ErrorHandler

End Function

What I want to do is that if someone updates the entry from outlook, then it updates the entry in access and vise versa.

I am guessing that as a first stage when the entry is initially added to outlook I need to get and store the entry ID for this but am not sure how this is done? Help appreciated.

Also then how do i update it from access to outlook? and then outlook to access?

Help appreciated.

Sample code would be great if anyone has done this before. I know it is possible just have no idea how to go about it.

If you need more detail please ask.
Thanks in advance.
Cheers,
Neemi
 
I've figured out that to get the entry ID I add the line of code as follows after the entry has been created:

Code:
    strEntryID = objAppt.EntryID

Help with editing from access to outlook and vise versa still needed and appreciated.

Cheers,
Neemi
 
mp9, thanks for responding but I actually wanted to try and do it without a link to the table.

Cheers,
Neemi
 
Do you know how I can actually add a reminder to somebody else's Calender via the Exchange server? via vba.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top