L
Linn Kubler
Hi,
I seem to be having trouble with the getNext method. In my routine I'm
simply trying to read out the first 10 entries in my folder. I go to the
first record, then enter a for loop and loop 10 times using getNext.
Problem is that it shows one record, then the next and then it keeps showing
the same record for the 10 iterations. Am I doing something wrong in my
code? Here it is:
Set myolApp.ActiveExplorer.CurrentFolder = _
myNamespace.GetDefaultFolder(olPublicFoldersAllPublicFolders).Folders("Deliveries")
Set orgDeliveriesFolder =
myNamespace.GetDefaultFolder(olPublicFoldersAllPublicFolders).Folders("Deliveries")
Set PatientRecord = orgDeliveriesFolder.Items().GetFirst
MsgBox ("Deliveries Folder Name = " & orgDeliveriesFolder.Name _
& Chr(13) & "No. of Patients = " &
orgDeliveriesFolder.Items().Count)
For I = 1 To 10
MsgBox ("Patient Name = " & PatientRecord.Subject & Chr(13) & _
"Location = " & PatientRecord.Location & Chr(13) & _
"Start = " & PatientRecord.Start & Chr(13) & _
"Categories = " & PatientRecord.Categories + Chr(13) & _
"Message = " & PatientRecord.Body)
' "Assessment Due = " & PatientRecord.UserProperties.Find("Assessment
Due") & Chr(13) & _
Set PatientRecord = orgDeliveriesFolder.Items().GetNext
Next I
Thanks in advance,
Linn
I seem to be having trouble with the getNext method. In my routine I'm
simply trying to read out the first 10 entries in my folder. I go to the
first record, then enter a for loop and loop 10 times using getNext.
Problem is that it shows one record, then the next and then it keeps showing
the same record for the 10 iterations. Am I doing something wrong in my
code? Here it is:
Set myolApp.ActiveExplorer.CurrentFolder = _
myNamespace.GetDefaultFolder(olPublicFoldersAllPublicFolders).Folders("Deliveries")
Set orgDeliveriesFolder =
myNamespace.GetDefaultFolder(olPublicFoldersAllPublicFolders).Folders("Deliveries")
Set PatientRecord = orgDeliveriesFolder.Items().GetFirst
MsgBox ("Deliveries Folder Name = " & orgDeliveriesFolder.Name _
& Chr(13) & "No. of Patients = " &
orgDeliveriesFolder.Items().Count)
For I = 1 To 10
MsgBox ("Patient Name = " & PatientRecord.Subject & Chr(13) & _
"Location = " & PatientRecord.Location & Chr(13) & _
"Start = " & PatientRecord.Start & Chr(13) & _
"Categories = " & PatientRecord.Categories + Chr(13) & _
"Message = " & PatientRecord.Body)
' "Assessment Due = " & PatientRecord.UserProperties.Find("Assessment
Due") & Chr(13) & _
Set PatientRecord = orgDeliveriesFolder.Items().GetNext
Next I
Thanks in advance,
Linn