Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Nov 2004
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Accessing Outlooks Calendar Items from Access (XP)

    Many thanks to those that have answered my last query.

    One further question.

    I have created for my clients two possible ways of creating a new meeting from Access linking Outlook. They both require a trade-off. The first which creates a meeting from within Access to Outlook has the disadvantage of not being able to check whether or not a meeting within Outlook will conflict with that being created in Access. It also suffers from not being able to be edited once written from Access to Outlook- it creates a new meeting, not editing an existing one.

    The second method involves opening an Outlook Meeting form from Access which gives the user the opportunity to check for conflicted times but suffers from not being able to have the data returned to Access for writing to file.

    What I would like to be able to do is create a new meeting or edit an existing meeting within Outlook from Access and being able to write this Add/Edit to file within Access. Anyone know of a way?

    Thank you

    Robin

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

    Re: Accessing Outlooks Calendar Items from Access (XP)

    Here is some sample code that finds an existing appointment (calendar item), and modifies its duration.

    Dim app As New Outlook.Application
    Dim nsp As NameSpace
    Dim fld As MAPIFolder
    Dim itm As Object
    Set nsp = app.GetNamespace("MAPI")
    Set fld = nsp.GetDefaultFolder(olFolderCalendar)
    Set itm = fld.Items.Find("[Subject]=""Important Meeting""")
    If Not (itm Is Nothing) Then
    itm.Duration = 120
    itm.Save
    End With
    Set itm = Nothing
    Set fld = Nothing
    Set nsp = Nothing
    app.Quit
    Set app = Nothing

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

    Re: Accessing Outlooks Calendar Items from Access (XP)

    Hi Robin,

    Your issue is one of the challenges of trying to maintain the data in two different places, whether it's contact info, meeting schedules, tasks or whatever. Automation of Outlook from Access (or vice-versa) gives you most of the tools you need to make the two talk, but either Outlook or Access has to be declared to be the official source and the place where you look for conflicts. Hans has given you some code that will let you edit an existing Outlook appointment, so that solves part of the problem. It would be wonderful if the Outlook folks would simply create an MDB datastore for us, but they persist in using a rather odd flat-file arrangement that goes back many years. Exchange does use a Jet-engine based approach, but it has been extensively modified and looks pretty foreign to Access developers.

    I think the answer may lie in continuing to store things in Outlook, and using extensive Automation code to do such things as meeting planning and task and reminder settings. If you haven't fully explored Automation, you may find our Automation Tutorial useful - it contains links to several useful MSKB articles and some book suggestions. The bottom line is you need to know the Outlook object model inside and out - and you will probably be frustrated by some of the limitaions. Forms for example are a pain compared to what you have in Access. Good luck with your project - keep us up to date on how you progress.
    Wendell

  4. #4
    New Lounger
    Join Date
    Nov 2004
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Accessing Outlooks Calendar Items from Access (XP)

    Thank you Hans & Wendell. This is certainly a great start.

Posting Permissions

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