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 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