Similar to the @Command([MailComposeMemo]) which composes a Memo document in the User’s mail file, I would like to create an agent in any database that creates a form (not of type Memo) within the User’s mail file.
My idea is to use LotusScript and db = s.getDatabase, however, how do you specify to get the particular user’s mail file? Or maybe I don’t need LotusScript and can accomplish this with @Formulas?
Subject: How to get the Users Mail Database using LotusScript?
This should get you started … it’s the OpenMail incantation that does the magic.
' Create the memo
Dim w As New notesUIWorkspace
Dim maildb As New NotesDatabase( "", "" )
Call maildb.OpenMail
Set memo = maildb.CreateDocument
Set uidoc = w.EditDocument( True , Memo )
Subject: RE: How to get the Users Mail Database using LotusScript?
Hi!
It works fine if user hasn’t opened his/Her mail database already, but if he has opened the maildb.OpenMail crashes. How can this be avoided? I can’t check it the db is already open since, I don’t have the database yet.
Subject: How to get the Users Mail Database using LotusScript?
does the form reside in the user’s mail database? Um, what is your goal, here? If you wish to create a document in the user’s mail database from within another database, consider an action that uses the ComposeDocument method of NotesUIWorkspace to compose the document in the frontend. Or, to create the document in the backend, Simply use the CreateDocument method of NotesDatabase and fill in the fields and the form field in your code.