Manage Learn to apply best practices and optimize your operations.

Delete a document when it is opened in UI

This tip describes how to delete a document opened in the UI.

Have you ever tried to delete a document that is opened on your desktop (using NotesDocument.Remove(flag) method)? If you did, you probably received this error message: "Cannot remove NotesDocument when instantiated by NotesUIDocument". Use the following function to avoid this error message and delete the document.


Sub RemoveUIDOC(source
 As notesuidocument)
 Dim doc As notesdocument
 Dim unid As String
 Dim db As notesdatabase
 
 Set db = source.document.
ParentDatabase
 unid = source.document.UniversalID
 Delete source
 Set doc = db.GetDocumentByUNID(unid)
 
 Call doc.Remove(True)
End Sub
 

Dig Deeper on LotusScript

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close