How to save user's changes in a view after ViewRebuild

Help please,

I have a view (OnlySpam) and user can change width of columns of that view. User changes (filters) entries of this view by using an action. This action changes SelectionFormula in associated back-end view (code in LS) and calls ViewRebuild. But after this action a user who has customized width of any column of (OnlySpam) view lost his/her changes.

My code:

Dim uiw As New NotesUIWorkspace

Dim uiview As NotesUIView

Dim view As NotesView

Dim formula As String

Dim one As String

Dim two As String

Dim ct As Integer

formula =|SELECT form = "Memo" & @Contains(@LowerCase(Subject); "[!! spam]")|



Set uiview = uiw.CurrentView

Set view = uiview.View

view.SelectionFormula = formula

Call uiw.ViewRebuild

ct = view.EntryCount

Print "The number of docs in this view: " & ct	& " (SPAM)"

thx for your help!

Subject: How to save user’s changes in a view after ViewRebuild

Don’t rebuild the uiview, refresh the view, then reopen the uiview.

Subject: RE: How to save user’s changes in a view after ViewRebuild

I think I have to use ViewRebuild because of changing my SelectionFormula. I use only one view (AllSPAM) with 3 different SelectionFormula. The SelectionFormula depends on a user decision what docs he/her wants to view. There are 3 types of spam docs. When a user wants to view 1st type of spam docs he/her clicks on 1st button then my LS code changes SelectionFormula for 1st type of spam docs and rebuilds (AllSPAM) view. And so on, if a user wants to view 2nd type of spam docs… The problem with (AllSPAM) view appears when a user changes width of one of columns of that view and chooses next type of spam docs. Then the size of changed column returns to its default size (not the user’s preferred width).

Subject: How to save user’s changes in a view after ViewRebuild

Robert,

I don’t know of any way to itemize a user’s customizations so that they can be programmatically applied to a view after that view has been rebuilt.

good luck,

raphael