Notesuidocument.document property

I’m trying to use this property in lotuscript to write a response document automatically. For some reason I always get a type mismatch when I run this code, but to the best of my knowledge, this is exactly what the property was created for.

Anyone think they can tell me what’s missing?

Thank you very much, here an enclosement of my code.

Sub Postsave(Source As Notesuidocument)

Dim sess As New notessession

Dim db As notesdatabase

Dim doc As notesdocument

Dim curdoc As NotesDocument

Dim ws As notesuiworkspace

Dim opendoc As notesuidocument

Set opendoc = ws.CurrentDocument

Set curdoc = opendoc.Document

Set db = sess.CurrentDatabase

Set doc = db.Createdocument

If curdoc.oldstatus >< curdoc.status Then

	doc.form = "HistoryStatus"

	Call doc.MakeResponse(curdoc)

	doc.Save True,True

End If

End Sub

Subject: notesuidocument.document property

You should get an “Object variable not set” since you didn’t instantiate the ws object.

Try this:

dim ws as New NotesUIWorkspace

HTH

Subject: notesuidocument.document property

Thanks guys, the code is working great.

Subject: notesuidocument.document property

the prob is on if curdoc…

try this.

if curdoc.oldstatus(0) <> curdoc.status(0) Then

ST