Trouble with NSFSearch

I have a problem using the Notes C API, with two main questions:

  1. How can NSFSearch do a search of a particular view? E.g. I want the items from $Inbox, or $MyView returned only.

  2. Can I get a custom field returned in the summary buffer after a call to NIFOpenCollection/NIFReadEntries?

Background on my problem/testing:

I have a list of view names (E.g. ($Inbox), ($Sent), … ($myView)), and I need to be able to get all Notes from each view (and only that view), with summary buffers that include a custom field. Basically I need to NOT call NSFNoteOpen to get this field, or find out if it exists.

The only way that I’ve been able to get a custom field in the summary buffer is to use NSFSearch. NIFOpenCollection/NIFReadEntries doesn’t seem to allow me to use a formula language expression anywhere, which is what I had to do to get NSFSearch to return me the field in the summary buffer.

The documentation for NSFSearch suggests it is possible to refine your search to a view by name. There is a ViewTitle parameter for NSFSearch and it says you are to use @ViewTitle somewhere in your formula spec. Unfortunately I don’t have enough experience with formula language or the Lotus API to make it work, or if what I want to do is even possible.

Formula language I expected to work:

formula := ‘DEFAULT CustomField := “foo”; @ViewTitle;’

And of course, the call to NSFSearch has the view name (E.g. ($Inbox)) as the ViewTitem (3rd) parameter.

Any help on this would be greatly appreciated. Thanks in advance.

-Stuart