Display/open a backend document

Looking for a way to Display or Open a backend document. I look for a document with a “GetDocumentByKey” method and if the document is found, I want to “open” it, or display it. Find the doc OK, but cannot get it to open. I get a type mismatch. Here is my code:

Dim session As New NotesSession

Dim workspace As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Dim db As NotesDatabase

Dim view As NotesView

Dim doc As NotesDocument

Dim keyName As String

Dim boxType As Long, answer As Integer

keyName = session.CommonUserName

Set db = session.CurrentDatabase

Set view = db.GetView (“resourceTracking” )

Set doc = view.GetDocumentByKey (keyName )

If Not (doc Is Nothing) Then

Set uidoc = doc.document	

End

Else

…

Subject: Display/open a backend document

John, take a look at the EditDocument method of the NotesUIWorkspace class. Despite its name, it allows you to open a back end document in read mode.

Subject: RE: Display/open a backend document

I used:Set uidoc = ws.EditDocument(True, doc, False)

and it works fine. Not sure I understand it, but thats ok.

Thanks, Jerry.