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

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.