Sub Initialize()
On Error GoTo a
'计算当期页面被打开的次数
Dim session As New NotesSession
Dim db As NotesDatabase
Set db = session.Currentdatabase
Dim doc As NotesDocument
Set doc = session.Documentcontext
Dim pdoc As NotesDocument
Set pdoc = db.Getprofiledocument("Domino") '获取简要表Domino,如果没有则创建Domino
Dim num As Double
Dim NumStr As String
'MsgBox pdoc.num(0)
NumStr = pdoc.num(0)
If NumStr ="" Then
Num = 1
Else
Num = CStr(NumStr)+1
End If
pdoc.num = CStr(num)
Call pdoc.save(False,False)
MsgBox num
doc.Number = num
Exit Sub
a:
MsgBox "错误在代理agent_num的第" & Erl & "行,描述:--" & Error
End Sub