Button To Select Mail Templates

If you are using @Picklist to choose a document, then the OpenView command to open the view and finally the OpenDocument...

command to open the document you might have noticed, the view will still be open after the User closed the selected document. This is sloppy - they should return to the place where they opened the Picklist. I've used this script for selecting Mail Templates with one Click. Greetings Kurt Muehlemann State Secretariate for Economic Affairs Effingerstrasse 1, 3001 Bern/Switzerland Phone +41 31 324 29 75, Fax +41 31 324 09 88 E-Mail kurt.muehlemann@seco.admin.ch Create View named : (MemoTemplates) 1st Column sorted ascending - Field: MAILSTATIONERYNAME 2nd Column: Value: @Text(@DocumentUniqueID) Create View named : (ByDocID) 1st Column sorted ascending - Value: @Text(@DocumentUniqueID) Create Action in Inbox Folder: DraftDocID:=@PickList( [Custom] :[Single] ; "" ; "(MemoTemplates)" ; "Select Mail template" ;_ "Please select the Mail Template you want to use:" ; 2); @Environment ("DOC";DraftDocID); @Command([ToolsRunMacro]; "Templates"); "" Create Agent: Sub Initialize Dim sess As New NotesSession Dim db As NotesDatabase Dim doc As NotesDocument Dim dcto As String Set db = sess.Currentdatabase dcto = sess.GetEnvironmentString("DOC") If dcto = "" Then Msgbox("No Template selected") Exit Sub End If Call sess.SetEnvironmentVar("DOC", "") Set doc = db.GetDocumentByUNID(dcto) If doc Is Nothing Then Msgbox ("ERROR: Template not found!") Exit Sub End If displaydocument doc End Sub Function DisplayDocument (doc As NotesDocument) As Integer Dim ws As New NotesUIWorkspace Dim db As NotesDatabase Dim vista As NotesView Dim vistadoc As NotesDocument Dim uidoc As Notesuidocument Set db = doc.ParentDatabase Set vista = db.getview ("(ByDocID)") Set vistadoc = db.GetDocumentByUnID (doc.UniversalID) Set uidoc = ws.EditDocument(True,vistadoc,False) End Function

This was first published in November 2000

Dig Deeper



Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:




  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...