Solved

Write from Outlook Calendar to Access Database

Posted on 2012-12-28
6
367 Views
Last Modified: 2013-01-02
We have an application that dymaically writes from an Access Database to a Shared Public Exchange Calendar.  When a user changes a date in the Database, it automatically adds, deletes or moves the item on this public calendar.

Now the users want to be able to move one of the items on the OUtlook Calendar and have it change the date in the Access Database.  

How can I do this?  I do have unique data that I link the field with the OUtlook object, so that isn't a problem.  I just don't know in Outlook VBA how to tell it to look at a Calendar entry and when it changes to do something.

Cheers for any guidance!
0
Comment
Question by:sharpapproach
  • 3
  • 3
6 Comments
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 38727413
Have you considered 'Linking' the Outlook data into Access?

Last time I checked, changes worked from both ways...
0
 

Author Comment

by:sharpapproach
ID: 38727723
That feature just creates a linked table.  We have our database that as users add and move things in different tables/fields, etc, then the Calendar updates.  

However, now the users to go the other way.

I have a public calendar called "Study Schedule", and when a user moves an item from one date to another, I have to have it go change some things in access.

I can't figure out how to know in Outlook VBA that a Public Calendar item has been moved/deleted/edited, etc.

If I can figure that out, I should be good to go.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 38727787
Then this seems to be more complex than I had originally thought...

Please wait for other Experts to reply
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

Accepted Solution

by:
sharpapproach earned 0 total points
ID: 38727824
After 2 hours of trying things , I figured it out... Add this code to the ThisOutlookSession Code:

Dim WithEvents m_objAppt As Outlook.AppointmentItem

Private Sub Application_ItemLoad(ByVal Item As Object)
    On Error Resume Next
    Dim strClass As String
    Select Case Item.Class
        Case olAppointment
            Set m_objAppt = Item
      End Select
End Sub

Private Sub m_objAppt_Open(Cancel As Boolean)
    'Put code here for opening
    'for example, to look at the subject
    '.m_objAppt.Subject
End Sub

Private Sub m_objAppt_Read()
    'put read code here.
End Sub

Private Sub m_objAppt_Unload()
    'don't put code here because object model won't see it.
   ' Set m_objAppt = Nothing
End Sub
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 38727879
Great,
Congrats on getting it working, and thanks for sharing the solution with the community.
;-)

Jeff
0
 

Author Closing Comment

by:sharpapproach
ID: 38736031
Figured it out myself and posted code for future users
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Set OWA language and time zone in Exchange for individuals, all users or per database.
Outlook Free & Paid Tools
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

746 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

10 Experts available now in Live!

Get 1:1 Help Now