title image


Smiley DocumentContext property
Example:



4. This agent increments a counter. You can use it to track the number of times a Web page is opened by calling it from WebQueryOpen. The counter is maintained in a profile document as an item named Access_counter. An item of the name exists for display purposes only in the document being opened.

Sub Initialize

Dim session As New NotesSession

Dim db As NotesDatabase

Dim doc As NotesDocument

Dim profile As NotesDocument

Dim num As Double

Dim numStr As String

Set doc = session.DocumentContext

Set db = session.CurrentDatabase

Set profile = db.GetProfileDocument("(AccessCounterProfile)")

numStr = profile.Access_counter(0)

If numStr = " " Or numStr = "" Then

num = 1

Else

num = Cdbl(numStr) + 1

End If

Call profile.ReplaceItemValue("Access_counter", Cstr(num))

Call profile.Save(False, False)

Call doc.ReplaceItemValue("Access_counter", Cstr(num))

End Sub
 Gruß
 Christoph

 « News4Notes »



geschrieben von

Login

E-Mail:
  

Passwort:
  

Beitrag anfügen

Symbol:
 
 
 
 
 
 
 
 
 
 
 
 
 

Überschrift: