In R5, you can preview a document you are creating in IE, Netscape, or the Notes client -- all with the click of a button. This code will give you the same functionality in 4.x to preview the current page in IE. Just make sure you've created a view that contains all documents and the first column is sorted by @Text(@DocumentUniqueID). For this script, I've called the view "$allpagelkup".
On the form, you need two hidden fields:
ServerName{serv:=@Subset(@DbName; 1);
@Name([CN]; serv)} and DocUNID{@Text(@DocumentUniqueID)}
Paste this code into an action button on the form:
Sub Click(Source As Button)
Dim ws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim ieApp As Variant
Dim s As New NotesSession
Dim db As NotesDatabase
Set uidoc = ws.CurrentDocument
Set db = s.CurrentDatabase
servname = uidoc.FieldGetText ( "ServerName" )
dirpath = db.FilePath
pagename = uidoc.FieldGetText ( "DocUNID" )
If pagename = "" Then
Msgbox "You must associate this page with a form!"
Exit Sub
End If
URL$ = "http://" & servname & "/" & dirpath & "/$allpagelkup/" & pagename & "?OpenDocument&login"
Call uidoc.Save ( )
Set ieApp = CreateObject("InternetExplorer.Application")
ieApp.Visible = True
ieApp.navigate(URL$)
End Sub
Requires Free Membership to View
Register today to access targeted resources from our editorial writers and independent industry experts focused on Lotus Domino, Notes, Workplace and other related technologies.
This was first published in November 2000