Open unsaved backend doc to a frame by LS

Hi all,

I have the below code to display some info on a docand dispaly the doc in a frame. However, the frame is displayed without showing the document in the frame:

“”“”“”“”“”“”“”“”“”

'On Error Resume Next

Dim ws As NotesUIWorkspace, ss As NotesSession, db As NotesDatabase, cudoc As NotesDocument 

Set ws= New NotesUIWorkspace 



Call ws.OpenFrameSet("FrameA")



Set ss=New NotesSession 

Set db=ss.CurrentDatabase 



Set cudoc=db.CreateDocument 



cudoc.form="frmA"

cudoc.Fd1="12345678"



Call ws.SetTargetFrame("ModifiedDoc")

Call ws.EditDocument(False, cudoc, False,,False)

‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’’

It is really really strange that if u

  1. saved the doc before displaying; or

  2. ‘Call ws.ComposeDocument(,“frmA”,False)’ instead of ‘editdocment’

the doc displayed correctly in the specific frame.

Any idea?

Thanks

Sam