< Back

Document Subject: Cannot remove notesdocument when instantiated by notesuidocument
Hint Short Cut: Add this to your code & documentation to help you find this page.
http://#instantiatedUidoc or http://A555F9/nn.nsf/ByAlias/instantiatedUidoc

This is an error that came up with early versions of Notes 6, but also can come up when performing background scripts when documents are still open in the foreground.




If you are using Notes 6 then upgrade to 6.5 with fixpack or better.

 

If you see this error when lotusscripting with code such as

   call draftdoc.remove(true)

then try putting this code in first

   Dim uiw As New notesuiworkspace
  Dim uidoc As notesuidocument
  Set uidoc=uiw.CurrentDocument
  Delete uidoc

   call draftdoc.remove(true)

If you alread have uidoc declared then just do delete uidoc.

You may want to try call uidoc.close() just before the delete uidoc if you still have trouble.

thanks to Gustavo Baez for this tip.