Opening document for editing after creating in script

I’m trying to create a document from a button in a view, then open the newly created document for editing before actually saving it. I want the user who is creating the document to check it for accuracy before hitting a ‘submit’ button…

Sub Click(Source As Button)

Set session=New NotesSession

Dim db As NotesDatabase

Set db=session.currentdatabase

Dim doc As New NotesDocument(db)

doc.form="Request"

doc.Emp=Inputbox ( "Enter Employee Name","Employee")

doc.Action="Departure"



      *** bring up employee data here, and enter it to new doc***

After this I want to open doc in the uiworkspace for editing. I tried “notesuidocument=notesuisworkspace.EditDocument(doc)” with no success…any suggestions?

Subject: Opening document for editing after creating in script

try this:

Sub Click(Source As Button)

Dim session As New NotesSession

Dim ws As New NotesUIWorkspace

Dim db As NotesDatabase

Set db=session.currentdatabase

Dim doc As NotesDocument

Dim uidoc As NotesUIDocument

Set doc = db.CreateDocument

doc.form="Request"

doc.Emp=Inputbox ( "Enter Employee Name","Employee")

doc.Action="Departure"

Set uidoc = ws.EditDocument(True, doc)

End Sub

Subject: RE: Opening document for editing after creating in script

that did the trick, thanks.