|
Tip>Designer>Word Functions |
|
|
Dynamically e-mailing a document |
|
|
Article #: |
0006 |
|
Contributor: |
Gail Moodie |
|
GF version: |
3.05 |
|
Applies to: |
E-mailing from Microsoft Word |
|
Last updated: |
July 19, 2001 |
Description
E-mails the active document as an attachment.
Explanation
Click here to view an explanation.
To e-mail an active document from within the document, insert the following function in a FillPoint at the end of the template:
WordApp.ActiveDocument.SendMail()
The SendMail function will e-mail the document in the state it is in at the time the function is called. It is advisable, therefore, to insert this function at the end of the template in order to send the completed document, i.e. after all FillPoints have been filled.
Your default e-mail client opens in a new message with the document attached. Fill in the details and send the document as follows:
Fill in the addressee details.
By default the Subject line will contain the title that Word has automatically assigned to the document e.g. Document2. But if you have already saved the document, the Subject line will contain a portion of the first line of text in the document.
You can set the contents of the subject line of the e-mail either in the template (each document's e-mail will then have the same subject line) or in the document itself. On the File menu, click Properties. In the Summary tab, type a new title in the Title box. Click OK.
Fill in the body of the message if required.
Click Send to send the message and return to the document.
|
NOTE |
%[WordApp.ActiveDocument.SaveAs('Transfer'&Transfer.Name)]
|
Template example
Click here to view an example of the solution in a template.
|
%[Transfer=Dialogs.Select('\Demo\Transfer',' ')] %[FormatDate(Transfer.Date, 'mmmm dd, yyyy')] %[Transfer.Name] %[Transfer.Address]
Dear %[Transfer.Name]
Property Transfer: %[Transfer.Property]
The amount of R%[Transfer.Amount] is owed by you for the above transfer. Please could you contact our offices at your earliest convenience to arrange payment.
Yours sincerely
P Anderson Attorney WILLOWMORE RUSKMAT & SMITH (Our Ref: PA/MB)
%[WordApp.ActiveDocument.SaveAs('Transfer'&Transfer.Name)] %[WordApp.ActiveDocument.SendMail()]
|
Click here to view the message that opens in the e-mail client.
(The document has been saved):