Notes Ninjas Notes Ninjas
Lotus Notes hints, tips, error messages
Cannot remove notesdocument when instantiated by notesuidocument

Hint Short Cut: Add this to your code & documentation to help you find this page.
http://www.notesninjas.com/#instantiatedUidoc or http://www.notesninjas.com/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.

 

 


 Jump to:     Notes Tips
    Lotus Notes Index 
  Register for Tips
Previous Lotus Notes Tip 
    Next Lotus Notes Tip
Your company logo here?
Adam Foster
Free Cash Making Web Site
Free Revenue Earning Blog Site
 Free Revenue Earning Newsletter Site   
Free Search Pages Free Web stats
Free Contact Us page
Cheap .com domain names
 Need a website or 
   Lotus Notes
  problem solved?
Adam Foster
Lotus Notes 5 All-in-one Certification Exam Guide by Libby Schwarz, Ben Malekzadeh
Sort out your CLP with this book.
See at: Amazon.co.uk | Amazon.com |