Solved

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

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

Assisted Solution

by:Rgonzo1971
Rgonzo1971 earned 500 total points
Comment Utility
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
Comment Utility
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 48

Expert Comment

by:Rgonzo1971
Comment Utility
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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 48

Accepted Solution

by:
Rgonzo1971 earned 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks for the help Rgonzo and sorry for the delay in the award.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

763 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now