Hi,When user open a doc we create a doc log in other db.
info we need:
date/time username accessMode doc.UniversalID
Actualy the code working great when user open the doc from a view.
But when the users open the doc via an attached docLink (by email) the log doesn’t created.
Here the code:
From ScripLib: LogParam
Sub Initialize
Dim ws As New NotesUIWorkspace
Set uiDoc2 = ws.CurrentDocument
On Event Postopen From uiDoc2 Call LogEvent
On Event PostSave From uiDoc2 Call UpdateEvent
End Sub
Sub LogEvent(uiDoc As NotesUIDocument)
Dim doc As NotesDocument
Dim s As New NotesSession
Dim serveurCN As String
Dim serveur As String
Dim path As String
Dim curdb As NotesDatabase
On Error Resume Next
Set curdb = s.Currentdatabase
’ logByView = true
serveur = curdb.Server
serveurCN = StrRight(StrLeftBack(serveur,“/”),“CN=”)
path = StrLeftBack(curdb.Filepath,"")
Set doc =uiDoc.Document
If Not uiDoc.IsNewDoc Then
If doc.ParentDatabase.Server = serveur Then
Set destDb = New NotesDatabase(serveurCN, path & "\ParamLog.nsf")
If DestDb.IsOpen Then
Dim formList As Variant
Dim aut As NotesItem
formList = getList()
Set logDoc = DestDb.CreateDocument()
Dim rt As NotesRichTextItem
Set rt = logDoc.CreateRichTextItem("LienDoc")
logDoc.Form = "Log"
logDoc.Nom = s.CommonUserName
logDoc.Dossier = .SOM_No_Dossier(0)
logDoc.Document = formList(doc.form(0))
logDoc.UNID = doc.UniversalID
logDoc.Action = 56
Set aut = logDoc.AppendItemValue("Auteur", s.UserName)
aut.IsAuthors = True
Call rt.AppendDocLink(doc, "")
logDoc.Save True, False
End If
End If
End If
End Sub
How can I pass uidoc via a docLink?
Any suggestion?
Thank in advance