Solved

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

Posted on 2014-12-11
7
275 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 52

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 52

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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 
LVL 52

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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
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…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

627 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