"variable object not set" when calling ComposeDocument

Hi,

I’m getting “Variable object not set” error when my script calls ws.CreateDocument. It was working previously and I’m not sure what I changed to cause this problem. Please help!

code snipplet: (inside an action button)

=========================

Sub Initialize

Dim ws As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

…

Set uidoc = ws.ComposeDocument( “”, “”, “orderFM” )

…

End Sub

========================

At one point when I was making modifications and saving the form, orderFM, Designer was making duplicate copies of the same form. I kept the latest copy and deleted the other two outdated forms. I’m not sure if this is related to the problem I’m having. Thanks.

WC

Subject: “variable object not set” when calling ComposeDocument

Look at the Queryopen, Postopen, etc. of the form - the error is probably there.Run this in debug mode, please.

Regards,

Simeon

Subject: RE: “variable object not set” when calling ComposeDocument

Thanks, Simeon.

I found what was wrong with it. I was trying to access a NotesDocument instance in QueryOpen of a new document that has not been previously saved.

WC