Hello, for R5 web client
I m facing some prob. to constract a url for my link in Lotus Script, as i m printing the search result as a document link.plz give me some advice like how to build url using lotus script.here is my code i have write some text to better understand. plz help me to give some code Thanx a lot friends
here is taht agent
Agent for display search result
Sub Initialize
Dim Session As New NotesSession
Dim db As New NotesDatabase( server, database)
Dim collection As NotesDocumentCollection
Dim doc As notesDocument
Dim doc1 As NotesDocument
Set doc1= session.DocumentContext
Dim webFilePath As String, URLBaseVue As String
Dim nbDocs As Integer, countDocs As Integer, i As Integer
’ set collection
Set collection = db.FTSearch(|doc1.FieldName(0)|,Nothing,0)
nbDocs = collection.count
’ if collection is not empty
If nbDocs > 0 Then
Set doc = collection.GetFirstDocument
’ Set base/view URL (view = 0 = default view)
webFilePath = ReplaceSubString(db.FilePath, "\" , "/")
URLBaseVue = "http://www.somewhereovertherainbow .com/" & webFilePath & "/0/"
’ open TABLE tag
Print |<table width=100%>|
’ loop thru collection
For i = 1 To nbDocs
’ Print one line for each document : add ID doc and ?OpenDocument command
Print |<tr><td><a href="| & URLBaseVue & doc.UniversalID & |?OpenDocument" >doc # | & Cstr(i) & |</a></td></tr>|' Get next doc
Set doc=collection.getnextdocument(doc)
Next
’ Close TABLE tag
Print |</table>|
End If
Exit Sub
End Sub
HERE IS A FUNCYTION TO CONSTRUCT URL OR CHANGE URL
Function ReplaceSubString(fullString As String, oldString As String, newString As String) As String
Dim position As Integer
Dim lenOldString As Integer
lenOldString = Len(oldString)
position = Instr(fullString, oldString)
Do While position > 0 And oldString <> ""
fullString = Left(fullString, position-1) & newString & Mid(fullString, position + lenOldString)
position = Instr(position + Len(newString), fullString, oldString)
Loop
ReplaceSubString = fullString
End Function
But it won’t work it will gives a url like C;/note/data/
n soooooo on. and my like was’t be open on the same path
but if i hard code it like in the same agent
URLBaseVue1 = “http://localhost/FIeldLevelFT.nsf/0/”
n then my code will be change here,just passing UrlBasevue1
Plzzzzz help as i we never hard code the url help me to create a url with lotus script.COZ DB.FILEPATH GIVES THE FULL PATH BUT I WANT ONLY
URLBaseVue = “http://www.somewhereovertherainbow .com/” & webFilePath & “/0/”
HELP ME FRIEND THANX A LOT FOR U…