Looping through a view with the Lotus Notes C++ API
May 22nd, 2006
Although this might seem like a pretty simple thing to do, you can end up going down quite a few dead end streets. The documentation show lots of examples of getting the first entry in a View but does not have any example of looping through all the entries in a view. A bit slack on the documenters part but hey the C++ API really is the poor cousin of the C API. Anyway, here's the code you need to use.
// vf is an LNViewFolder object that holds the view we want to process
// This code also assumes that there will be at least one entry in the view
LNVFNavigator nav;
LNText lntColumnValue;
vf.GetEntries(&nav);
do{
nav.GetEntry(&entry);
lntColumnValue = entry["Column Name"]; // Where "Column Name" is the title of the column you want to access
}while(nav.GotoNext() != LNWARN_NOT_FOUND);