coronoahcoro
asked on
Notes error: Invalid or nonexistent document ; when unlocking a document
This question is related to this question:
https://www.experts-exchange.com/questions/26551298/Use-color-on-Lotus-Notes-View.html
1. It was working last week and today it is giving me the error message
2. The form was created from a button that contains these code:
@Command([FileSave]);
@Command([Compose];"";"Fle xRepairPro cess");
3. The FlexRepairProcess form created and saved just fine but when I close the form, the code stops at the Queryclose event when it tries to unlock the document
Sub Queryclose(Source As Notesuidocument, Continue As Variant)
Dim doc As NotesDocument
Set doc = source.Document
Call doc.UnLock
End Sub
Again this has been working for almost 2 weeks and suddenly it stopped working. I googled this problem and most people have problem with their mail files and that's not the case with me.
https://www.experts-exchange.com/questions/26551298/Use-color-on-Lotus-Notes-View.html
1. It was working last week and today it is giving me the error message
2. The form was created from a button that contains these code:
@Command([FileSave]);
@Command([Compose];"";"Fle
3. The FlexRepairProcess form created and saved just fine but when I close the form, the code stops at the Queryclose event when it tries to unlock the document
Sub Queryclose(Source As Notesuidocument, Continue As Variant)
Dim doc As NotesDocument
Set doc = source.Document
Call doc.UnLock
End Sub
Again this has been working for almost 2 weeks and suddenly it stopped working. I googled this problem and most people have problem with their mail files and that's not the case with me.
ASKER
This happens only the very first time after the document is created, saved, and closed. The error doesn't show up anymore afterward. I can open and close document (+ unlocking it) just fine.
ASKER
I had to do it explicitly because in the past when I tested this, there were times when a document is in locked status even though that doc was saved and close.
I suppose it won't work on a new (or newly saved) document. Can you just leave the lock in that case? Or, dirty: add a line with
On Error Resume Next
right before the line with Unlock...
On Error Resume Next
right before the line with Unlock...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Don't delete the question, for it might help someone else with a similar problem. Just accept your own answer.
ASKER
ok will do. thanks
ASKER
This is what works in this case
If there is indeed a disk-based document (which I doubt), the error could be related to some sort of bug in Notes where it gets confused between two on-screen documents. Sometimes it's worth to grab NotesUIWorkspace.CurrentDo