Lock document problem

Hi

I have a problem. I need to modify a document via Back-End, if it´s open in Edit Mode it´s not problem, because I have a LS code, it checks if if document is busy, here my code:

Dim posa1 As Integer

Dim posa2 As Integer

Dim vUserT As String

Dim m As String

If doc.LockHolders(0) <> “” Then

posa1 = Instr(doc.LockHolders(0),"=")

posa2 = Instr(doc.LockHolders(0),"/")

vUserT = Mid(doc.LockHolders(0),posa1 + 1, posa2 - posa1 - 1)

m = "Document is locked by " + vUserT + Chr(13)

m = m + "Please try again"

Messagebox m,0+16,"Error"

uidoc.Document.apDateSigned = ""

uidoc.Document.apSignedBy = ""

uidoc.Document.apStatus = ""

uidoc.Document.Save True, True	

Continue = False

Exit Sub

End If

My problem is when a user keeps document open in Read Mode, because when it happen doc.LockHolders(0) is equal to “”. When I write in back end when document is open, a Conflict Error is sent. Allow document locking is enabled.

Some body can helpme with any idea how can I check if document is busy in Edit/Read mode?

Thanks a lot.

Subject: Lock document problem

I guess you could check if the NotesDocument is open in the ui (if its in read or edit mode it has to be open in the ui). There’s a property in the NotesDocument class called IsUIDocOpen. Using that property you could check if the document is open in front-end. IF that property is false then do your stuff else wait until the document is closed or just cancel the action.

I’m not really sure this is the kind of information you need, but I hope it will help.