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.

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

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

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:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.