Dialogbox problem, help please,

Hi,I have the sample question regarding the Dialogbox in LotusScript, basically I add the following codes on the action button of a view, select any document(s) from this view, and click this button, I want to open the selected document in a dialogbox with a subform, But I got the error message" Dialogbox cannot be used in this context; a documetn must be selected".

I also copied some example from design help, it seems give me the same error,

Does anybody know what’s wrong with my codes?


Dim workspace As New NotesUIWorkspace

Dim doc As NotesDocument

Dim db As notesdatabase

Dim flag1 As Integer

Dim collection As notesdocumentcollection

Dim session As New NotesSession

Set db=session.CurrentDatabase

Set collection = db.UnprocessedDocuments

Set doc = collection.GetFirstDocument()

flag1 = workspace.DialogBox( "Sub-form name" , True , True  , False  , False , False , False , "test1" , doc , True , False)

Subject: RE: Dialogbox problem, help please,

Use the debugger to confirm what the value of doc is when you make the call.

Subject: RE: Dialogbox problem, help please,

Hi,Yes, I do use debug and got the doc object,the doc object is exist, but how come it come with the error messages?

I also try copy and paste the code on the Design help as the follows on an action button, I got the same error messages, you can try that codes on your machine, do you get the same error messages?

Thanks a lot for your help,


Sub Click(Source As Button)

Dim db As NotesDatabase

Dim s As New NotesSession

Dim workspace As New NotesUIWorkspace

Dim view As NotesView

Dim doc As NotesDocument

Set db = s.CurrentDatabase

Set view = db.GetView( “By Category” )

Set doc = view.GetFirstDocument

Call workspace.DialogBox _

(“Dialog Box”, True, True, False, False, False, _

False, “Dialog Box”, doc)

Call doc.save (True, False)

End Sub