Solved

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

Posted on 2014-12-11
7
270 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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
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…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

679 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