One of our users complained that when he opens a document through a doclink and he already has that document open, Notes just opens the document again.it is not aware that it is already open.
When you try to open the document again from a view there is no problem the first document gets the focus.
I have looked around this forum and the internet and came to this ‘solution’ which works in combination with our custom locking so i can check whether the user supposedly has the document already open for editing:
If EditStat(0) = session.EffectiveUserName Then
'doc locked by ‘me’
If session.GetEnvironmentString(“e_Skipcheck”) = “1” Then
'do nothing just open
Call session.setenvironmentvar(“e_SkipCheck”,“”)
Else
call session.setenvironmentvar(“e_SkipCheck”,“1”)
Call source.close(True)
Dim newdoc As notesdocument
Dim ws As New notesuiworkspace
Dim unid As String
unid = source.document.universalid
Set newdoc = db1.GetDocumentByUNID(unid)
call ws.editdocument(False,newdoc,False)
Call session.setenvironmentvar(“e_SkipCheck”,“”)
End If
End If
What it comes down to is that when there is a lock on the document it will re-open it with ws.editdocument.
This all works fine but the document then does not get focus.
Does anyone have any suggestions on how to get focus of the document (the one that was already open)?
Thanks in advance!