Type Mismatch on dialogbox

I have run into a problem where by creating a new document directly causes no issues, however when trying to do this through a dialogbox in LotusScript, I get a Type Mismatch error. I tried to use LotusScript to create a new document but still get the same message.

Here is the LotusScript called from a Button on a Form:

Dim workspace As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Set uidoc = workspace.CurrentDocument



Call workspace.DialogBox("F_TSE",True,True,True,True,True,False,"New Entry",,True,True,False)

I have tried the following to try and simulate a fresh new document with the same Type Mismatch error:

Dim session as New NotesSession

Dim workspace As New NotesUIWorkspace

Dim db as NotesDatabase

Dim uidoc As NotesUIDocument

Set db = session.CurrentDatabase

Set uidoc = workspace.CurrentDocument

Dim doc as New NotesDocument( db )

Call workspace.DialogBox(“F_TSE”,True,True,True,True,True,False,“New Entry”,doc,True,True,False)

Would anyone have any ideas on why this only occurs when calling the dialogbox?

Subject: Type Mismatch on dialogbox

I have tried the following code and no error message got returned. I am clueless as to why this is occuring on the dialogbox call.

Dim workspace As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Set uidoc = workspace.CurrentDocument

Call workspace.ComposeDocument( “”, “”, “F_TSE” )

Subject: RE: Type Mismatch on dialogbox

I found the problem to be due to an issue in the Postopen event of the document.

The Postopen event checked to see if the document was new and if so put a 0 in a double variable.

It seems that a document in a dialogbox event is not considered new even when creating a new document object.

Subject: RE: Type Mismatch on dialogbox

Just FYI – “New Document” means “composed but never saved”. You are not creating a “New Document” because you are not composing anything. You created the document in the back end, so as far as the form is concerned, you are actually editing an existing document. Note that the LotusScript property NotesDocument.IsNewNote will remain true until a document is actually saved to the database.