Lotus Notes Knowledge Base, Document# 140997, Dated 07/07/2000. Using the Document property of the NotesUIDocument class, a back-end document handle can be obtained from a front-end document. Subsequently, the properties and methods of this NotesDocument object can be used. If, however, the ComposeDocument method of the NotesUIWorkspace is used to create a new front-end document, the Document property of the NotesUIDocument cannot be set until the NotesUIDocument has been saved. Solution Given: This was reported to Lotus Quality Engineering, but it was determined that Notes is functioning as designed.
Until a save has been performed, the document (note) exists only in memory. It is not possible to set the Document property for document that exists only in memory.
You can get a handle on the document property of the newly composed document by declaring and setting the document in the postopen event of the form being composed.
(From the calling Agent) Dim ws As New NotesUIWorkspace Dim newDoc As notesdocument Dim newUIdoc As notesuidocument Set newUIdoc = ws.composeDocument("","","newDoc") Set newDoc = newUIdoc.document 'This will get handle on document to allow manipulation (From the Postopen event in the "newDoc" form) Sub Postopen(Source As Notesuidocument) Dim doc As NotesDocument Set doc = Source.Document End Sub