locked
Outlook calendar displayed in outlook based on date selected RRS feed

  • Question

  • Hi there, in our access database i have code that allows a user to create an outlook appointment, which can be seen below:

        Dim objOutlook As Object
        Dim objItem As Object
        Set objOutlook = CreateObject("Outlook.Application")
        Set objItem = objOutlook.CreateItem(olAppointmentItem)
        With objItem
        .Subject = Title & " " & ": Appointment"
        End With
        objItem.Display
        Set objOutlook = Nothing

     

    however, what would be really useful is if it could go one step further and open existing calendar items rather thana new item. we have a section on the access database where users enter activity i.e. work done with a client on a particular date - it would be really nice if when the user selects a date on this activity screen that they could also maybe hit a command button that would open up their outlook calendar on the same date as the date selected within access itself so they can quicky copy and paste some of the information that they have previosuly entered in their calendar into their activity.  or even that hitting the button opens up an access form that holds information from the relevant fields from their outlook calendar - i have seen this done and have done it myself but the opposite way i.e. you write it into outlook.  unfortunately this now doesnt work for us becasue we do our activity retrospectively.

     

    any help would be greatly appreciated

    Thursday, March 25, 2010 12:39 PM

Answers

  • Hi Rhys,

    We could use the Items.Restrict method to find the exact Appointment in Outlook, the code should be like this:

    Application.Session.GetDefaultFolder(olFolderCalendar).Items.Restrict().GetFirst().Display

    For a sample code please refer to this link:

    http://msdn.microsoft.com/en-us/library/bb960908.aspx

    Thanks.

     


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    • Marked as answer by Tim Li Friday, April 2, 2010 9:46 AM
    Monday, March 29, 2010 11:33 AM