Examples: Resolve method
- This Visual Basic sub resolves a database URL showing various
ways to construct the URL.
Private Sub Command1_Click()
Dim s As New NotesSession
Dim db As NotesDatabase
Dim target As NotesDatabase
Dim theURL As String
s.Initialize
Set db = s.GetDatabase("", "Document examples 2.nsf")
Rem Construct URL using NotesURL
theURL = db.NotesURL
MsgBox theURL, , "NotesURL"
Set target = s.Resolve(theURL)
MsgBox target.Title, , "Target title"
Rem Construct URL using FileName
theURL = "notes:///" + db.FileName + "?OpenDatabase"
MsgBox theURL, , "FileName"
Set target = s.Resolve(theURL)
MsgBox target.Title, , "Target title"
Rem Construct URL using ReplicaID
theURL = "notes:///" + db.ReplicaID + "?OpenDatabase"
MsgBox theURL, , "ReplicaID"
Set target = s.Resolve(theURL)
MsgBox target.Title, , "Target title"
Rem Construct URL using constant database name
theURL = "notes:///Document examples 2?OpenDatabase"
Rem Also OK: "notes:///Document examples 2.nsf?OpenDatabase"
Rem Also OK: "notes:///Document+examples+2?OpenDatabase"
Rem Also OK: "notes:///Document+examples+2.nsf?OpenDatabase"
MsgBox theURL, , "Constant database name"
Set target = s.Resolve(theURL)
MsgBox target.Title, , "Target title"
Rem Construct URL using constant replica ID
theURL = "notes:///8525690D006AC34D?OpenDatabase"
Rem Also OK: "notes:///__8525690D006AC34D.nsf?OpenDatabase"
MsgBox theURL, , "Constant replica ID"
Set target = s.Resolve(theURL)
MsgBox target.Title, , "Target title"
End Sub
- This Visual Basic sub resolves the URL for a view.
Private Sub Command2_Click()
Dim s As New NotesSession
Dim db As NotesDatabase
Dim target As NotesView
Dim theURL As String
s.Initialize
Set db = s.GetDatabase("", "Document examples 2.nsf")
theURL = "notes:///Document examples 2/Main View?OpenView"
MsgBox theURL, , "Constant database and view names"
Set target = s.Resolve(theURL)
MsgBox target.Name, , "Target name"
End Sub
- This LotusScript® agent
resolves the URL for a view.
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim target As NotesView
Dim theURL As String
Set db = session.GetDatabase("", "Document examples 2.nsf")
theURL = "notes:///Document examples 2/Main View?OpenView"
Messagebox theURL, , "Constant database and view names"
Set target = session.Resolve(theURL)
Messagebox target.Name, , "Target name"
End Sub
Have feedback?
Google Analytics is used to store comments and ratings. To provide a comment or rating for a topic, click Accept All Cookies or Allow All in Cookie Preferences in the footer of this page.