Forwarding A Document Thru' Script

The following code gives you "Forwarding a mail" functionality in script. Same
functionality can be attained using formula but there are situations where you
want to forward a document thru script. Let's see some of the places where we
can use it.

1. Notes Document to be sent to users thru script and also who don't have
access to the application.
2. Some updation has be done thru script and also wants to forward this
document to some users.
3. Want to forward a document without user intervention.
Create a new form in your database and call it as "Memo". Create the following
1. From
2. SendTo
3. CopyTo
4. BlindCopyTo
5. Subject
6. Body
7. SaveOptions and set it to computed and value as "0".

Enable the property "Inherit entire selected document into Rich Text Field" and
select the field name as "Body" and "Rich Text". Now, Save and Close the form.

Let's say you have Monthly Sales Details form and a mail has to be triggered
with this document on close event. Type the following code in the close event
of the document.

Sub Queryclose(Source As Notesuidocument, Continue As Variant)
Dim oUiWs As New NotesUiWorkspace
Dim oUiDoc As NotesUiDocument
Set oUiDoc = oUiWs.ComposeDocument("","","Memo2")
Call oUiDoc.FieldSetText("SendTo","xx")
Call oUiDoc.FieldSetText("Subject","Monthly Sales Details")
Call oUiDoc.Send
Call oUiDoc.Close
end sub

Check the mail. Hope this helps.
This was first published in November 2000
This Content Component encountered an error



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'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 ...