Results 1 to 12 of 12
  1. #1
    5 Star Lounger
    Join Date
    May 2001
    Location
    Patterson Lakes, Melbourne, Victoria, Australia
    Posts
    636
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Outlook data from Access (Access 2002 Sp2)

    Does anyone know how to get appointments from an Access Db Calender program to the Outlook Calendar?
    What fields are required? How can I use OLE to do it? Can it be done only one way (from Access to Outlook). Can it be based on a query? Is there existing code to do it?
    It is to work in Access 2000 & XP.
    Regards,
    Peter

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Outlook data from Access (Access 2002 Sp2)

    I don't know about Outlook 2000, but Outlook 2002 can import a table from Access. For Calendar Items, you will want to have at least fields Subject, StartDate, StartTime, EndDate and EndTime in the table.

    - Select File | Import and Export...
    - Select "Import from another program or file", then click Next.
    - Select "Microsoft Access", then click Next.
    - Click Browse... to select a database, then click Next.
    - Select the Calendar folder, then click Next.
    - Select the table by ticking its check box.
    - Click "Map custom fields".
    - If the field names in the Access table correspond to those in Outlook, the correspondence will be automatic; otherwise, you will have to drag Access fields to the corresponding Outlook fields.
    - Click OK, then Finish.

    This only works with tables, not with queries.

    You could also use Automation to do this from Access; you would create an instance of Outlook in code and control it from Access. See MSKB article ACC2000: How to Use Automation to Add Appointments to Microsoft Outlook. You can adapt the code given there to loop through the records of a table or query.

  3. #3
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Outlook data from Access (Access 2002 Sp2)

    To amplify on Hans' response a bit, we have use the Automation approach in several instances to create either appointments or tasks in Outlook when records are added or edited in Access. You can also mark a task complete, or change an appointment date/time, and set reminders using that approach. The import option is useful on a one-time basis, but is limited if you want to really tie the two together.
    Wendell

  4. #4
    5 Star Lounger
    Join Date
    May 2001
    Location
    Patterson Lakes, Melbourne, Victoria, Australia
    Posts
    636
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Outlook data from Access (Access 2002 Sp2)

    As usual Hans you are a fount of knowledge. Thanks, this will help enormously.
    Regards,
    Peter

  5. #5
    5 Star Lounger
    Join Date
    May 2001
    Location
    Patterson Lakes, Melbourne, Victoria, Australia
    Posts
    636
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Outlook data from Access (Access 2002 Sp2)

    Thanks Wendell. Do you have any code snippets that would enable me to check if the appnt about to be entered from Access to Outlook is already in Outlook?
    Regards,
    Peter

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Outlook data from Access (Access 2002 Sp2)

    The attached text file contains an example; it is not meant as complete code, but as a starting point.

    The MatchAppointment function takes a start date, start time, end date, end time and subject as arguments and loops through the appointments in the Outlook calendar to look for a match. If found, it returns True.
    Attached Files Attached Files

  7. #7
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Outlook data from Access (Access 2002 Sp2)

    Hans has provided a good start, so let me just add a small point we uncovered that may be useful. In general, users will want to add their own appointments manually, and it becomes important to not mess with those inadvertently when using automation. To deal with that we set a special field in one of the optional Outlook fields where we stored a primary key value associated with the Access appointment, and we then used that to make sure we were dealing with an appointment (or task) that had been created by the Automation routines.
    Wendell

  8. #8
    5 Star Lounger
    Join Date
    May 2001
    Location
    Patterson Lakes, Melbourne, Victoria, Australia
    Posts
    636
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Outlook data from Access (Access 2002 Sp2)

    Thanks Hans. Not being at all familiar with the Outlook object model, I was groping in the dark. Not any more.
    Tremendous help (as always)
    Regards
    Regards,
    Peter

  9. #9
    5 Star Lounger
    Join Date
    May 2001
    Location
    Patterson Lakes, Melbourne, Victoria, Australia
    Posts
    636
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Outlook data from Access (Access 2002 Sp2)

    Thanks Wendell (Gramps). Excellent stuff. Between Hans & yourself, I think I can accomplish what I want.
    The whole thing started when I got a new phone (Nokia 6600) with a synchronizable calender. The only thing that I posses that it will sync with is Outlook, which I don
    Regards,
    Peter

  10. #10
    2 Star Lounger
    Join Date
    May 2002
    Location
    Dubai, UAE, United Arab Emirates
    Posts
    105
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Outlook data from Access (Access 2002 Sp2)

    Edited by HansV to replace ridiculously large screenshot by somewhat smaller one. Please don't post 1400 pixels wide pictures.

    G'day Hans
    To extend this a little - any idea of the model to create recurring items into Outlook from Access. I've been searching the forums and the web for a while without success. I have some idea from my object browser (see attached) but not enought to start coding with ...
    Regards Ken
    Attached Images Attached Images

  11. #11
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Outlook data from Access (Access 2002 Sp2)

    This is not an Access question. Once you know how to create a recurring item in Outlook VBA, it is a (relatively) simple matter of creating an Outlook application object, as in the code I attached to a previous reply in this thread, and use this object to execute the Outlook code. I suggest that you post a question in the Outlook forum on how to create a recurring appointment in Outlook VBA.

  12. #12
    2 Star Lounger
    Join Date
    May 2002
    Location
    Dubai, UAE, United Arab Emirates
    Posts
    105
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Outlook data from Access (Access 2002 Sp2)

    No worries. Someone has already posted in the Outlook forum (64386) - I'll keep an eye on that one.
    Regards Ken

Posting Permissions

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