P
PeterM
Below I have code I found which goes thru my Outlook Calendar and searches
for items. As a test, I first tried to find the calendar entry based on the
subject, which worked fine. I next tried to find it based on the calendar
location, which worked fine. However, when I tried to find it based on the
calendar start, it never finds it. I've tried the following values but none
of them work.
#3/29/2010 9:15:00 AM#
"3/29/2010 9:15:00 AM"
#03/29/2010 09:15:00 AM#
(#3/29/2010 9:15:00 AM#)
"03/29/2010 09:15:00 AM"
I've also created a variable as a type of date, set it to the value and it
was still not recognized.
When I run the following code with the debug.print, it displays
3/29/2010 9:15;00 AM
but when I step thru the code it does not recognize the value. Can anyone
please tell me how to find the calendar entry based on the calendar start
date?
I would appreciate it very much
Dim objFolder As Outlook.MAPIFolder
Dim objExplorer As Outlook.Explorer
Dim objSubFolder As Outlook.MAPIFolder
Dim objCalenderItem As Outlook.AppointmentItem
For Each objFolder In Session.Folders
Set objExplorer = objFolder.GetExplorer()
For Each objSubFolder In objExplorer.CurrentFolder.Folders
If objSubFolder.DefaultItemType = olAppointmentItem Then
For Each objCalenderItem In objSubFolder.Items
If objCalenderItem.Subject = ("03/28/2010 09:15:00 AM")
Then
MsgBox objCalenderItem.Subject & ", " &
objCalenderItem.Location & " " & objCalenderItem.Start & " " &
objCalenderItem.End & " " & objCalenderItem.Body
' Debug.Print objCalenderItem.Subject & ", " &
objCalenderItem.Location & " " & objCalenderItem.Start & " " &
objCalenderItem.End & " " & objCalenderItem.Body
End If
Next
End If
Next
Next
Set objFolder = Nothing
Set objExplorer = Nothing
Set objSubFolder = Nothing
Set objCalenderItem = Nothing
for items. As a test, I first tried to find the calendar entry based on the
subject, which worked fine. I next tried to find it based on the calendar
location, which worked fine. However, when I tried to find it based on the
calendar start, it never finds it. I've tried the following values but none
of them work.
#3/29/2010 9:15:00 AM#
"3/29/2010 9:15:00 AM"
#03/29/2010 09:15:00 AM#
(#3/29/2010 9:15:00 AM#)
"03/29/2010 09:15:00 AM"
I've also created a variable as a type of date, set it to the value and it
was still not recognized.
When I run the following code with the debug.print, it displays
3/29/2010 9:15;00 AM
but when I step thru the code it does not recognize the value. Can anyone
please tell me how to find the calendar entry based on the calendar start
date?
I would appreciate it very much
Dim objFolder As Outlook.MAPIFolder
Dim objExplorer As Outlook.Explorer
Dim objSubFolder As Outlook.MAPIFolder
Dim objCalenderItem As Outlook.AppointmentItem
For Each objFolder In Session.Folders
Set objExplorer = objFolder.GetExplorer()
For Each objSubFolder In objExplorer.CurrentFolder.Folders
If objSubFolder.DefaultItemType = olAppointmentItem Then
For Each objCalenderItem In objSubFolder.Items
If objCalenderItem.Subject = ("03/28/2010 09:15:00 AM")
Then
MsgBox objCalenderItem.Subject & ", " &
objCalenderItem.Location & " " & objCalenderItem.Start & " " &
objCalenderItem.End & " " & objCalenderItem.Body
' Debug.Print objCalenderItem.Subject & ", " &
objCalenderItem.Location & " " & objCalenderItem.Start & " " &
objCalenderItem.End & " " & objCalenderItem.Body
End If
Next
End If
Next
Next
Set objFolder = Nothing
Set objExplorer = Nothing
Set objSubFolder = Nothing
Set objCalenderItem = Nothing