.
HCLSoftware Business Partner
Domino Consulting Services
CRUCIAL Notes Tools
+1
212-599-2048
Domino Consulting Services
CRUCIAL Notes Tools
Domino administration
Notes development
Chat now
.
EN - English
CN - 中文
JP - 日本語
DE - Deutsch
FR - Français
BR - Português
RU - Pу́сский
IT - Italiano
IN - हिन्दी
ES - Español
KR - 한국어
ID - Indonesia
NL - Dutch
TR - Türkçe
SA - العربية
SE - Svenska
NO - Norsk
PL - Polski
TH - ไทย
DK - Dansk
MY - Malay
PH - Filipino
GR - Ελληνικά
FI - Suomi
IL - עברית
IE - Gaeilge
CZ - Čeština
UA - Українська
RO - Română
VN - Tiếng Việt
BD - বাংলা
HU - Magyar
Need a Domino Consultant? Call NotesMail +1 212-599-2048
-
HCLSoftware Business Partner
LOTUSSCRIPT/COM/OLE CLASSES
Examples: DocumentContext property
1. This agent displays the Subject item of the current document when run from a view in the Notes client.
Sub Initialize
Dim session As NotesSession
Set session = New NotesSession
Dim doc As NotesDocument
Set doc = session.DocumentContext
Messagebox doc.Subject(0),, "Subject"
End Sub
2. This agent displays the Subject item of the current document when run by @Command([ToolsRunMacro]) in a browser.
Sub Initialize
Dim session As NotesSession
Set session = New NotesSession
Dim doc As NotesDocument
Set doc = session.DocumentContext
Print "<H2>" + doc.Subject(0) + "</H2>"
End Sub
3. This agent displays the CGI variable Remote_Addr when run in a browser by the OpenAgent URL command, or by @Command([ToolsRunMacro]) if Remote_Addr is a field on the form supporting the current document.
Sub Initialize
Dim session As NotesSession
Set session = New NotesSession
Dim doc As NotesDocument
Set doc = session.DocumentContext
Print "<H2>IP address is " + _
doc.Remote_Addr(0) + "</H2>"
End Sub
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
See Also
DocumentContext property
Feedback on
Help
or
Product Usability
?
Help on Help
All Help Contents
Feedback on
Help
or
Usability
?
Help on Help
All Help Contents