Construct WebDbName in LotusScript

Use this when you need to determine the web-friendly URL for the current database directly.
LotusScript


Function GetWebDbName As string
	
	Dim ss As New NotesSession
	Dim db As NotesDatabase
	Set db=ss.currentdatabase
	
	Dim dbfilepath As String
	dbfilepath = db.filepath
	
	Dim valueLength As Integer
	valueLength = Len(db.filepath)
	
	Dim dbfilepath2 As String
	Dim character As String
	
	Dim i As Integer
	For i= 1 To valueLength Step 1
		character = Mid(db.filepath,i,1)
		If character="\" Then
			dbfilepath2 = dbfilepath2 & "/"
		Else
			dbfilepath2 = dbfilepath2 & character
		End If
	Next

	GetWebDbName = dbfilepath2
	
End Function

Written by fbrefere001

Posted by fbrefere001 on Monday June 24, 2019