Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old October 23rd, 2003, 03:19 AM
Authorized User
Join Date: Jul 2003
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts
Default Using Outlook Calendar in Access

Hi Guys/Gals, I know you can help on this one.
I want to use the Outlook Calendar system from within Access 2002. I would use VBA to create reminders in Calendar and then let Outlook do the reminding/follow up. I've tried a linked table to the Calendar folder but the fields displayed are very limited.
Rather than re-inventing the wheel, can someone point me towards a understandable description of the Appointment Object model and what properties to use in this case.
Thanks in advance.

Cheers Ray
Cheers Ray
Old October 24th, 2003, 11:33 AM
Authorized User
Join Date: Jun 2003
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts

Ray use this....
Private Sub cmdReminder_Click()
On Error GoTo Err_cmdReminder_Click

    Const conerr = 94
    Dim stDocName As String
    Dim stLinkCriteria As String
    Dim strSubject As String
    Dim strBody As String
    Dim strDueDate As String
    Dim strCusName As String

    strCusName = DLookup("[CompanyName]", "[Customers]", "[CustomerID]=CustomerID")

    strSubject = "Help Desk Ticket: '" & Me.ServiceRecordID & "' (for - " & strCusName & ")"

    If Not IsNull(Me.ProblemDescription) Then
        strBody = Me.ProblemDescription
        MsgBox "You need to Enter a Problem Description", vbCritical, "Missing Info"
        Exit Sub
    End If

    If Not IsNull(Me.FollowUpDate) Then
        strDueDate = Me.FollowUpDate
        MsgBox "You need to Enter A Follow-Up Date", vbCritical, "Missing Info"
        Exit Sub
    End If

    If Not IsNull(strSubject) Then
        ap_CreateOLTask strSubject, strBody, strDueDate
        MsgBox "You Need To Enter All Information!", vbCritical, "Missing Information"
    End If

    Exit Sub

    If Err = conerr Then
        MsgBox "You are Missing Information", vbCritical, "Missing Information"
        Exit Sub
        MsgBox Err.Description
        Exit Sub
    End If

End Sub

Public olkApp As Outlook.Application
Public olkNameSpace As Outlook.NameSpace

Public Sub ap_CreateOLTask(strSubject As String, strBody As String, _
                            strDueDate As String)

    Dim objTaskItem As TaskItem

    Set olkApp = New Outlook.Application
    Set olkNameSpace = olkApp.GetNamespace("MAPI")
    Set objTaskItem = olkApp.CreateItem(olTaskItem)

    With objTaskItem
        .Subject = strSubject
        .DueDate = strDueDate
        .Status = olTaskInProgress
        .ReminderSet = True
        .ReminderTime = (strDueDate) & " " & CDate(#9:00:00 AM#)
        .Categories = "Task From Access"
        .Body = strBody
    End With

    Set objTaskItem = Nothing
    Set olkNameSpace = Nothing
    Set olkApp = Nothing

End Sub

Old October 27th, 2003, 04:44 AM
Authorized User
Join Date: Jul 2003
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts

Thanks I'll give it a try

Cheers Ray

Similar Threads
Thread Thread Starter Forum Replies Last Post
Displaying Outlook Calendar in/thru Visual Basic mjai VB Components 1 August 20th, 2008 02:57 PM
Outlook Calendar (in VB) seananderson VB Components 2 September 28th, 2007 05:22 AM
Send MS Outlook Calendar Entry From ASP.NET wackoyacky ASP.NET 2.0 Basics 0 June 17th, 2007 10:02 AM
outlook calendar on web page Seeker55 Javascript How-To 0 March 28th, 2006 03:30 PM
Outlook calendar Selected Dates? avinashgavali Access 0 January 24th, 2005 01:42 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.