What is easiest way to update Outlook using Access?

  • Thread starter Help with Access to Outlook
  • Start date
H

Help with Access to Outlook

I would like to use Access to manage my contacts. Access has a very good
template for doing that. I then want to export the data to Outlook. The
field names and characteristics do not match. Any ideas how to fix would be
greatly appreciated.
 
J

James

Here is some code that sends information to the calendar, but it is the same
principle If you need help with definition I would go to an Outlook
newsgroups and post there. You do realize that most of the information below
will have to be changed to suit your needs. Don't forget to set your object
to nothing at the end!

------------Start code---------------
Dim objOApp As New Outlook.Application
Dim objAppt As AppointmentItem
Dim oExp As Outlook.Explorer
Dim i As Long
Dim j As Long
Dim oItems As Outlook.Items
Dim oFilter As Outlook.Items
Dim sEventID As String

Set oItems = objOApp.Session.GetDefaultFolder(olFolderCalendar).Items
sEventID = Forms![frmOrder]![Events].Form!EventID
Set oFilter = oItems.Restrict("[Subject] = '" & sEventID & "'")
Set objAppt = objOApp.CreateItem(olAppointmentItem)
Set oExp = objOApp.Session.GetDefaultFolder(olFolderInbox).GetExplorer

If oFilter.Count > 0 Then
'item already exists with that value
j = oFilter.Count
For i = j To 1 Step -1
Set oAppt = oFilter(i)
oAppt.Delete
With objAppt
.ReminderOverrideDefault = True
.ReminderSet = True
.ReminderMinutesBeforeStart = 1440 '1 Day
.Subject = EventID
.Importance = 2 ' high
.Start = PUDate
.End = DODate
.Body = PULocation & " - " & DOLocation & " - " & Notes & " - " &
EventDescription
.MeetingStatus = 1
.ResponseRequested = False
.Save 'Comment out if you do not want message saved to your sent
items folder
.Send
MsgBox "The event has been updated."
End With
Next i


Else

With objAppt
.ReminderOverrideDefault = True
.ReminderSet = True
.ReminderMinutesBeforeStart = 1440 '1 Day
.Subject = EventID
.Importance = 2 ' high
.Start = PUDate
.End = DODate
.Body = PULocation & " - " & DOLocation & " - " & Notes & " - " &
EventDescription
.MeetingStatus = 1
.ResponseRequested = False
.Save 'Comment out if you do not want message saved to your sent
items folder
.Send
MsgBox "The event has been sent."

End With

End If

Set objOApp = Nothing
Set objAppt = Nothing
Set oExp = Nothing
Set oItems = Nothing
Set oFilter = Nothing

End Sub
--------end code------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top