Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Jun 2001
    Location
    Bethlehem, Pennsylvania, USA
    Posts
    64
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Access to Outlook: Send an appointment to a specific calendar

    I found a very nice article about sending an appointment from Access to Outlook calendar. Here is the link: http://support.microsoft.com/kb/160502/en-us
    This works very nicely but it sends the appointment to the default calendar. Is there a way to have the appointment go to a specific calendar. In my case the calendar is called "SP Events"
    The code I used is:
    Code:
    Private Sub AddAppt_Click()
             On Error GoTo AddAppt_Err
             ' Save record first to be sure required fields are filled.
             DoCmd.RunCommand acCmdSaveRecord
             ' Exit the procedure if appointment has been added to Outlook.
             If Me!AddedToOutlook = True Then
                MsgBox "This appointment already added to Microsoft Outlook"
                Exit Sub
             ' Add a new appointment.
             Else
                Dim outobj As Outlook.Application
                Dim outappt As Outlook.AppointmentItem
                Set outobj = CreateObject("outlook.application")
                Set outappt = outobj.CreateItem(olAppointmentItem)
                With outappt
                   .Start = Me!ApptDate & " " & Me!ApptTime
                   .Duration = Me!ApptLength
                   .Subject = Me!Appt
                   If Not IsNull(Me!ApptNotes) Then .Body = Me!ApptNotes
                   If Not IsNull(Me!ApptLocation) Then .Location = _
                      Me!ApptLocation
                   If Me!ApptReminder Then
                      .ReminderMinutesBeforeStart = Me!ReminderMinutes
                      .ReminderSet = True
                   End If
                   .Save
                End With
             End If
             ' Release the Outlook object variable.
             Set outobj = Nothing
             ' Set the AddedToOutlook flag, save the record, display a message.
             Me!AddedToOutlook = True
             DoCmd.RunCommand acCmdSaveRecord
             MsgBox "Appointment Added!"
          Exit Sub
          AddAppt_Err:
             MsgBox "Error " & Err.Number & vbCrLf & Err.Description
             Exit Sub
          End Sub
    Thanks in advance
    Dave
    Last edited by RetiredGeek; 2014-03-05 at 12:51. Reason: Added Code Tags

  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,496
    Thanks
    3
    Thanked 42 Times in 42 Posts
    I think this MS Community thread and the link it contains may have the answer.
    Wendell

  4. #3
    Star Lounger
    Join Date
    Jun 2001
    Location
    Bethlehem, Pennsylvania, USA
    Posts
    64
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you Wendell. This is exactly what I need.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •