E
Eric
H!! I want to open a calender from code so that I can view/edit an
appointment. I found this code. It works great. However, I don't want to
open the specific appointment, I just want to
display the calendar for that day (where the appointment is). Any ideas?
/e
Dim ol As New Outlook.Application
Dim ns As Outlook.NameSpace
Dim fdCalendar As Outlook.MAPIFolder
Dim itmsCalendar As Outlook.Items
Dim itm As Object
Dim criteria As String
Set ns = ol.GetNamespace("MAPI")
'Reference the deafult Calendar folder and then
'return the Items collection of the folder
Set fdCalendar = ns.GetDefaultFolder(olFolderCalendar)
Set itmsCalendar = fdCalendar.Items
'Establish the criteria and locate the Appointment
criteria = "[Subject] = " & "'" & Subject & "'" & ""
Set itm = itmsCalendar.Find(criteria)
'Determine if the item was found
If itm Is Nothing Then
MsgBox "Unable to locate the item."
FindAnAppt = False
Else
'Display the Appointment
itm.Display
FindAnAppt = True
End If
appointment. I found this code. It works great. However, I don't want to
open the specific appointment, I just want to
display the calendar for that day (where the appointment is). Any ideas?
/e
Dim ol As New Outlook.Application
Dim ns As Outlook.NameSpace
Dim fdCalendar As Outlook.MAPIFolder
Dim itmsCalendar As Outlook.Items
Dim itm As Object
Dim criteria As String
Set ns = ol.GetNamespace("MAPI")
'Reference the deafult Calendar folder and then
'return the Items collection of the folder
Set fdCalendar = ns.GetDefaultFolder(olFolderCalendar)
Set itmsCalendar = fdCalendar.Items
'Establish the criteria and locate the Appointment
criteria = "[Subject] = " & "'" & Subject & "'" & ""
Set itm = itmsCalendar.Find(criteria)
'Determine if the item was found
If itm Is Nothing Then
MsgBox "Unable to locate the item."
FindAnAppt = False
Else
'Display the Appointment
itm.Display
FindAnAppt = True
End If