View Outlook Appointments Within MS Access

D

Dave Hopper

Hi

I am trying to use automation to link appointments within an MS
Outlook Public Folders Calendar and an MS Access Application.

I have successfully modified existing code to ADD and Delete the
appointments to the Public Folder Calendar and this works well.
However, I need to view individual appointments based on a unique ID
that is stored in the BillingInformation field when an appointment is
added. This is so that the data in access that relates to a job
record can be updated if someone changes the date/time/engineer etc
from within MS Outlook. The fields I need to view are Date, Time,
Subject, Location and Body Text and these should then be displayed in
an access form with controls of the same name.

I have searched the groups and the web and can find no reference to
the code I need, however this must be similar to the code I am using
to delete appointments as this references appointments by the unique
ID that I save the appointment with originally.

I would be so grateful for any code snippets or advice. I have
attached my Delete code below for reference:

Dim objOL As Outlook.Application
Dim objNS As Outlook.NameSpace
Dim strFind As String
Dim objCalFolder As Outlook.MAPIFolder
Dim AllPublicFolders As Outlook.MAPIFolder
Dim MyPublicFolder As Outlook.MAPIFolder
Dim colCalendar As Outlook.Items
Dim objAppt As Outlook.AppointmentItem

Dim myOlApp
Dim mNameSpace

Dim MyItem
Dim strMsg

Dim strPublicFolder
Dim strSubject
Dim strStart
Dim strEnd
Dim strBody
Dim strLocation
Dim strRequiredAttendees
Dim strCategories
Dim strBillingInformation


Const olAppointmentItem = 1

strPublicFolder = ("Office")

If Len(strPublicFolder) > 0 Then

Set objOL = CreateObject("Outlook.Application")
Set mNameSpace = objOL.GetNamespace("MAPI")
'Set objCalFolder = objNS.GetDefaultFolder(olFolderCalendar)
Set objCalFolder = mNameSpace.Folders("Public Folders")
Set AllPublicFolders = objCalFolder.Folders("All Public Folders")
Set MyPublicFolder = AllPublicFolders.Folders("Office")
Set colCalendar = MyPublicFolder.Items

strFind = "[BillingInformation] = " & " " & "" & " " & Me!UniqueID
Set objAppt = colCalendar.Find(strFind)
If Not objAppt Is Nothing Then
objAppt.Delete
End If

Set objOL = Nothing
Set objNS = Nothing
Set objCalFolder = Nothing
Set colCalendar = Nothing

End If

Dave Hopper
 
D

Dave Hopper

Hi

I am trying to use automation to link appointments within an MS
Outlook Public Folders Calendar and an MS Access Application.

I have successfully modified existing code to ADD and Delete the
appointments to the Public Folder Calendar and this works well.
However, I need to view individual appointments based on a unique ID
that is stored in the BillingInformation field when an appointment is
added. This is so that the data in access that relates to a job
record can be updated if someone changes the date/time/engineer etc
from within MS Outlook. The fields I need to view are Date, Time,
Subject, Location and Body Text and these should then be displayed in
an access form with controls of the same name.

I have searched the groups and the web and can find no reference to
the code I need, however this must be similar to the code I am using
to delete appointments as this references appointments by the unique
ID that I save the appointment with originally.

I would be so grateful for any code snippets or advice. I have
attached my Delete code below for reference:

Dim objOL As Outlook.Application
Dim objNS As Outlook.NameSpace
Dim strFind As String
Dim objCalFolder As Outlook.MAPIFolder
Dim AllPublicFolders As Outlook.MAPIFolder
Dim MyPublicFolder As Outlook.MAPIFolder
Dim colCalendar As Outlook.Items
Dim objAppt As Outlook.AppointmentItem

Dim myOlApp
Dim mNameSpace

Dim MyItem
Dim strMsg

Dim strPublicFolder
Dim strSubject
Dim strStart
Dim strEnd
Dim strBody
Dim strLocation
Dim strRequiredAttendees
Dim strCategories
Dim strBillingInformation


Const olAppointmentItem = 1

strPublicFolder = ("Office")

If Len(strPublicFolder) > 0 Then

Set objOL = CreateObject("Outlook.Application")
Set mNameSpace = objOL.GetNamespace("MAPI")
'Set objCalFolder = objNS.GetDefaultFolder(olFolderCalendar)
Set objCalFolder = mNameSpace.Folders("Public Folders")
Set AllPublicFolders = objCalFolder.Folders("All Public Folders")
Set MyPublicFolder = AllPublicFolders.Folders("Office")
Set colCalendar = MyPublicFolder.Items

strFind = "[BillingInformation] = " & " " & "" & " " & Me!UniqueID
Set objAppt = colCalendar.Find(strFind)
If Not objAppt Is Nothing Then
objAppt.Delete
End If

Set objOL = Nothing
Set objNS = Nothing
Set objCalFolder = Nothing
Set colCalendar = Nothing

End If

Dave Hopper


I posted this message yesterday and have had no responses. As I am
under pressure to finish a project I really would appreciate a reply.

Many thanks in advance.

David Hopper.
 
M

Milly Staples [MVP - Outlook]

Try reposting this in a programming group - you will likely find the
programming types hang out there.

--
Milly Staples [MVP - Outlook]

Post all replies to the group to keep the discussion intact. Due to
the (insert latest virus name here) virus, all mail sent to my personal
account will be deleted without reading.

After searching google.groups.com and finding no answer, Dave Hopper asked:

| (e-mail address removed) (Dave Hopper) wrote in message
| || Hi
||
|| I am trying to use automation to link appointments within an MS
|| Outlook Public Folders Calendar and an MS Access Application.
||
|| I have successfully modified existing code to ADD and Delete the
|| appointments to the Public Folder Calendar and this works well.
|| However, I need to view individual appointments based on a unique ID
|| that is stored in the BillingInformation field when an appointment is
|| added. This is so that the data in access that relates to a job
|| record can be updated if someone changes the date/time/engineer etc
|| from within MS Outlook. The fields I need to view are Date, Time,
|| Subject, Location and Body Text and these should then be displayed in
|| an access form with controls of the same name.
||
|| I have searched the groups and the web and can find no reference to
|| the code I need, however this must be similar to the code I am using
|| to delete appointments as this references appointments by the unique
|| ID that I save the appointment with originally.
||
|| I would be so grateful for any code snippets or advice. I have
|| attached my Delete code below for reference:
||
|| Dim objOL As Outlook.Application
|| Dim objNS As Outlook.NameSpace
|| Dim strFind As String
|| Dim objCalFolder As Outlook.MAPIFolder
|| Dim AllPublicFolders As Outlook.MAPIFolder
|| Dim MyPublicFolder As Outlook.MAPIFolder
|| Dim colCalendar As Outlook.Items
|| Dim objAppt As Outlook.AppointmentItem
||
|| Dim myOlApp
|| Dim mNameSpace
||
|| Dim MyItem
|| Dim strMsg
||
|| Dim strPublicFolder
|| Dim strSubject
|| Dim strStart
|| Dim strEnd
|| Dim strBody
|| Dim strLocation
|| Dim strRequiredAttendees
|| Dim strCategories
|| Dim strBillingInformation
||
||
|| Const olAppointmentItem = 1
||
|| strPublicFolder = ("Office")
||
|| If Len(strPublicFolder) > 0 Then
||
|| Set objOL = CreateObject("Outlook.Application")
|| Set mNameSpace = objOL.GetNamespace("MAPI")
|| 'Set objCalFolder = objNS.GetDefaultFolder(olFolderCalendar)
|| Set objCalFolder = mNameSpace.Folders("Public Folders")
|| Set AllPublicFolders = objCalFolder.Folders("All Public Folders")
|| Set MyPublicFolder = AllPublicFolders.Folders("Office")
|| Set colCalendar = MyPublicFolder.Items
||
|| strFind = "[BillingInformation] = " & " " & "" & " " &
|| Me!UniqueID Set objAppt = colCalendar.Find(strFind)
|| If Not objAppt Is Nothing Then
|| objAppt.Delete
|| End If
||
|| Set objOL = Nothing
|| Set objNS = Nothing
|| Set objCalFolder = Nothing
|| Set colCalendar = Nothing
||
|| End If
||
|| Dave Hopper
|
|
| I posted this message yesterday and have had no responses. As I am
| under pressure to finish a project I really would appreciate a reply.
|
| Many thanks in advance.
|
| David Hopper.
 

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