doc.RemoveFromFolder odd behavior

Here’s my objective: I’d like to open a memo, and upon closing, have it be moved from the Inbox to a “Read Msgs” folder. This is so multiple people using the database will know whether or not a document has already been read. In the QueryClose event, I have the following script, just below the Call Source.QueryClose(Continue) line that comes in the template:

Call cMemoObject.QueryClose(Continue)

Dim uiws As New NotesUIWorkspace

Call source.document.PutInFolder(“Read msgs”)

Call source.document.RemoveFromFolder(“Inbox”)

Print “Memo moved to ‘Read msgs’; removed from ‘Inbox’.”

Problem is that the message doesn’t get removed from the Inbox folder. Also (the code is not shown), but I tried doing a refresh of the view, but in the QueryClose event was not able to get a handle to the ws.CurrentView object.

Any suggestions?

Subject: RE: doc.RemoveFromFolder odd behavior

The name of the inbox folder is not Inbox, but ($Inbox)

Subject: RE: doc.RemoveFromFolder odd behavior

Thank you Andre. That works. Is there a way to refresh the current uiView? There isn’t a Refresh method for NotesUiView, and the following code (trying to refresh the back-end) doesn’t work (I get ‘Object variable not set’):

Sub Queryclose(Source As Notesuidocument, Continue As Variant)

Call cMemoObject.QueryClose(Continue)



Dim ws As New NotesUIWorkspace



Call source.document.PutInFolder("Read messages")	

Call source.document.RemoveFromFolder("($Inbox)")



Call ws.CurrentView.View.Refresh

End Sub

Subject: RE: doc.RemoveFromFolder odd behavior

Try …

Call notesUIWorkspace.ViewRefresh

Subject: RE: doc.RemoveFromFolder odd behavior

Thanks Carl, that did the trick!