Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_cdo thread: Looping through a collection...not working!!


Message #1 by "Mark Parter" <mparter@f...> on Tue, 18 Mar 2003 12:02:58
Hi,

I've been testing some ASP/Exchange integration on my machine localyl 
(running Win2K Pro). I got everything working fine but I've now transfered 
all the files to the server and I can't get any of the collection loops to 
extract any information. I don't receive any error messages, just no 
output.

Here's an example that works fine locally but not on the server. I know 
the server can talk to the Exchange server fine because other items are 
working.
--------------------------------------------------------------------
dteStartDate = CDate(dteWeekStart)
dteEndDate = CDate(DateAdd("d", 6, dteStartDate))

strProfileInfo = strServer & vblf & strMailbox
Set objSession = CreateObject("MAPI.Session")
objSession.Logon , , False, True, 0, True, strProfileInfo

Set objCalendarFolder = objSession.GetDefaultFolder
(CdoDefaultFolderCalendar)
Set objMessages = objCalendarFolder.Messages

'get the appointments for the current week
Set objFilter = objMessages.Filter
objFilter.Fields.Add CdoPR_END_DATE, dteStartDate
objFilter.Fields.Add CdoPR_START_DATE, dteEndDate

intCounter = 0
For Each objAppointment In objMessages
	intCounter = intCounter + 1
	Response.Write objAppointment.ID
Next
objSession.Logoff
--------------------------------------------------------------------

If I output the value of the 'intCounter' variable, no matter how many 
appointments I have in the calendar for that week, it only shows 1!

Anybody have any ideas?

Thanks

  Return to Index