Hi everyone!
The problem is: I have a mail-in database. In it’s memo form, there is a “reply” button.
Right now this button does the following:
Dim s As New NotesSession
Dim ws As New NotesUIWorkspace
Dim doc As NotesDocument
Set doc = s.CurrentDatabase.CreateDocument()
doc.Form=“Memo”
doc.SendTo = ws.CurrentDocument.Document.From(0)
Dim nam As New NotesName(Trim(Cstr(ws.CurrentDocument.Document.From(0))))
doc.From = nam.Abbreviated
doc.Subject = ws.CurrentDocument.Document.Subject(0)
Dim item As NotesItem
Set item = ws.CurrentDocument.Document.GetFirstItem(“Body”)
Call item.CopyItemToDocument(doc, “Body”)
doc.SaveOptions = 0
doc.MailOptions = 0
Call ws.EditDocument(True, doc)
, and opens a “memo” form - but not in a Notes’ mail editor (which you can see when you compose a new mail message).
My question is:
How to compose a new memo in Notes’ memo editor + set my own recipient/subject/body?
Thanks in advance,
Dmitry.
Subject: Opening a standard Notes’ memo editor - ?
I think you want to be using the notesuiworkspace method compose rather than create. From the help:
Sub Click(Source As Button)
Dim workspace As New NotesUIWorkspace
Call workspace.ComposeDocument( “”, “”, “Main Topic” )
End Sub
…this should give you the memo form you actually want to see.
Subject: Re: Opening a standard Notes’ memo editor - ?
…but how about programmatically setting Subject & Adress?
Subject: RE: Re: Opening a standard Notes’ memo editor - ?
Once you have the new document open you can set field values using the notesuidocument method FieldSetText:
Call source.FieldSetText( “subject”, “put your text here” )
Hope it helps.
Subject: Re: Re: Opening a standard Notes’ memo editor - ?
…once again - but:
What if I whant to get text from external document?
I need a way to set Subject field BEFORE opening a Notes’ memo.
Subject: RE: Re: Re: Opening a standard Notes’ memo editor - ?
You can set values within the UIdocument once it is open and can get the data from another document using the GetFieldText method. I assume that the user is clicking an action within another document and it is this document which holds the values you want to populate into the subject field?
I would simply start the script by getting the values you want to populate into the new document and once the new document is composed then set subject and such like.
Post the script you have if you are having a problem and I will take a look.