Solved

How to add, remove and edit MS Outlook Tasks and Calendar Items using MS Access

Posted on 2014-12-11
7
269 Views
Last Modified: 2014-12-29
I would like to produce a CRM system in MS Access 2007 for multiple users.  As part of the system I would like tasks and calendar items (planned visits to prospects) to appear in MS Outlook.  I would like to be able to add, edit and remove these tasks and calendar items within the MS Access application and have them automatically updated in Outlook.

I found the following article helpful:
http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/A_4316-Automate-Outlook-in-VBA-with-the-OutlookCreateItem-Class.html
but this only creates the items so I'm not sure about editing/removing them from within the MS Access application.

What is the best way to go about doing this and how easy is it to do? (I'm very experienced with MS Access / VBA, but I have limited MS Office automation experience.)
0
Comment
Question by:Oliver Wastell
  • 3
  • 3
7 Comments
 
LVL 50

Assisted Solution

by:Rgonzo1971
Rgonzo1971 earned 500 total points
ID: 40493486
Hi,

see example deleting task items with Due Date 29.6.2015

Sub GetTask()

    Dim olApp As Outlook.Application
    Dim olNs As Namespace
    Dim Fldr As MAPIFolder
    Dim olTsk As TaskItem

    Set olApp = New Outlook.Application
    Set olNs = olApp.GetNamespace("MAPI")
    Set Fldr = olNs.GetDefaultFolder(olFolderTasks)
    i = 1

    For Each olTsk In Fldr.Items
        If olTsk.DueDate = #6/26/2003# Then
            olTsk.Delete
        End If
    Next olTsk

    Set olTsk = Nothing
    Set Fldr = Nothing
    Set olNs = Nothing
    Set olApp = Nothing

End Sub

Open in new window

Regards
0
 
LVL 3

Author Comment

by:Oliver Wastell
ID: 40493499
Hi Rgonzo,
Thanks for that.  If I want to edit/delete a particular item originally created by the Access application (there might be several on the same due date) how would I do that?  
Thanks
0
 
LVL 50

Expert Comment

by:Rgonzo1971
ID: 40493516
You could save the EntryID in Access when creating your task to be able to retrieve it

See limitations
http://msdn.microsoft.com/en-us/library/office/ff868464(v=office.15).aspx
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 50

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 40493532
Or you could add a user property

see

        Set myUserProperty = olTsk.UserProperties _
        .Add("myProperty", olText)
        myUserProperty.Value = "Dummy"

and read it later

If olTsk.UserProperties("myProperty") = "Dummy"

Regards
0
 
LVL 3

Author Comment

by:Oliver Wastell
ID: 40493547
Rgonzo: your last post looks promising. I'll give that a try before coming back and awarding points.  Thanks.
0
 
LVL 31

Expert Comment

by:Helen_Feddema
ID: 40497034
My Working with Outlook ebook has many examples of working with Outlook items of various sorts from Access (it includes sample databases).  I can't give a direct plug here, but you can find it on the Office Watch Website.  

There are also several free code samples on the Code Samples page of my Website:

http://www.helenfeddema.com/Code Samples.htm
0
 
LVL 3

Author Closing Comment

by:Oliver Wastell
ID: 40522617
Thanks for the help Rgonzo and sorry for the delay in the award.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question