Solved

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

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

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 51

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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
LVL 51

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
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…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

734 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