home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / WordProcessors / DAT-WW5C.DMS / in.adf / Archive / WwRexx.lha / Mail_Merge_Tutorial < prev    next >
Encoding:
Text File  |  1996-02-09  |  5.0 KB  |  169 lines

  1. /*    Mail_Merge_Tutorial
  2.  
  3.         Digita Wizard Script for Wordworth 5
  4.         Copyright ©1996, Digita International Ltd.
  5.         
  6.         Created: 19 January 1996
  7.         Author:  Mark Jackson
  8. */
  9.  
  10.  
  11. OPTIONS RESULTS
  12.  
  13.  
  14. OldPortName = Address()
  15.  
  16. WizardReq TITLE "Mail Merge Wizard" LABEL "This wizard will show you how to use" LABEL "Wordworth's Mail Merging feature." LABEL "" BUTTON 1 "_OK" BUTTON "-1" "_Cancel"
  17. If Result = -1 THEN
  18.     Exit
  19.  
  20. If Result = 1 THEN
  21.  
  22. /* Demo */
  23.  
  24. WizardReq TITLE "Mail Merge Wizard" LABEL "First we need to create a data file" LABEL "containing the mail merge information." LABEL "You can export this from a database" LABEL "program, e.g. Datastore, but we will" LABEL "create it in Wordworth" BUTTON 1 "_OK" BUTTON "-1" "_Cancel"
  25. If Result = -1 THEN
  26.     Exit
  27.  
  28. New
  29. Address Value Result
  30.  
  31. Document A4 "0.5in" "0.5in" "0.6in" "1.0in"
  32.  
  33. Font NAME "Shannon Book" SIZE 12
  34.  
  35. WizardReq TITLE "Mail Merge Wizard" LABEL "We will have 5 fields in our example" LABEL "database. First we'll set up some" LABEL "tabs, so the text is nicely laid out." LABEL "You would do this by simply clicking" LABEL "on the horizontal ruler." BUTTON 1 "_OK" BUTTON "-1" "_Cancel"
  36. If Result = -1 THEN DO
  37.     Close FORCE
  38.     Exit
  39. END
  40.  
  41. SetTab LEFT "2in"
  42. SetTab LEFT "3.5in"
  43. SetTab LEFT "5in"
  44. SetTab LEFT "6.5in"
  45.  
  46. WizardReq TITLE "Mail Merge Wizard" LABEL "Each field must be seperated by a Tab," LABEL "with a Return at the end of each record." LABEL "The first line gives names to the different" LABEL "fields, we'll enter this information first." BUTTON 1 "_OK" BUTTON "-1" "_Cancel"
  47. If Result = -1 THEN DO
  48.     Close FORCE
  49.     Exit
  50. END
  51.  
  52. Text 'Name    Street    Town    County    Postcode'
  53. NewParagraph
  54.  
  55. WizardReq TITLE "Mail Merge Wizard" LABEL "Now we need to enter the actual" LABEL "data into the fields." LABEL "You can create as many records" LABEL "as you like, we'll make 3." BUTTON 1 "_OK" BUTTON "-1" "_Cancel"
  56. If Result = -1 THEN DO
  57.     Close FORCE
  58.     Exit
  59. END
  60.  
  61. Text 'Mr Smith    13 Park Avenue    Norwich    Norfolk    NE11 4BD'
  62. NewParagraph
  63. Text 'Mr Jones    7 Main Road    Exmouth    Devon    EX8 1JL'
  64. NewParagraph
  65. Text 'Mrs Simpson    41 Church Street    Taunton    Somerset    TA24 7PP'
  66.  
  67. WizardReq TITLE "Mail Merge Wizard" LABEL "Next we need to save the file" LABEL "in ASCII format" BUTTON 1 "_OK" BUTTON "-1" "_Cancel"
  68. If Result = -1 THEN DO
  69.     Close FORCE
  70.     Exit
  71. END
  72.  
  73. Saveas ASCII NAME "MergeData"
  74.  
  75. WizardReq TITLE "Mail Merge Wizard" LABEL "Now the data file has been" LABEL "created and saved, we will need" LABEL "to create the document we wish" LABEL "to merge it with." BUTTON 1 "_OK" BUTTON "-1" "_Cancel"
  76. If Result = -1 THEN DO
  77.     Close FORCE
  78.     Exit
  79. END
  80.  
  81. Close FORCE
  82.  
  83. Address Value OldPortName
  84.  
  85. New
  86. Address Value Result
  87.  
  88. Document A4 "0.5in" "0.5in" "0.6in" "1.0in"
  89.  
  90. Font NAME "Shannon Book" SIZE 12
  91.  
  92. WizardReq TITLE "Mail Merge Wizard" LABEL "We'll type a standard letter, but tell" LABEL "Wordworth to insert the fields in" LABEL "the data file at the appropriate places" LABEL "by entering the field names, surrounded" LABEL "by the mail merge symbols '«' and '»'." BUTTON 1 "_OK" BUTTON "-1" "_Cancel"
  93. If Result = -1 THEN DO
  94.     Close FORCE
  95.     Exit
  96. END
  97.  
  98. RightJustify
  99. Text 'Digita International Ltd.'
  100. NewParagraph
  101. Text 'Black Horse House'
  102. NewParagraph
  103. Text 'Exmouth'
  104. NewParagraph
  105. Text 'Devon'
  106. NewParagraph
  107. Text 'EX8 1JL'
  108. NewParagraph
  109. Paragraph 0 0 0 RIGHT AUTO SINGLE NONE "6 pt"
  110. Text 'ENGLAND'
  111. NewParagraph
  112. Paragraph 0 0 0 RIGHT AUTO SINGLE NONE NONE
  113. Text 'Tel: (01 395) 270 273'
  114. NewParagraph
  115. LeftJustify
  116. NewParagraph
  117. Text '«Name»'
  118. NewParagraph
  119. Text '«Street»'
  120. NewParagraph
  121. Text '«Town»'
  122. NewParagraph
  123. Text '«County»'
  124. NewParagraph
  125. Text '«Postcode»'
  126. NewParagraph
  127. NewParagraph
  128. Text 'Dear «Name»,'
  129. NewParagraph
  130. NewParagraph
  131. Paragraph 0 0 0 LEFT AUTO SINGLE NONE "6 pt"
  132. Text 'We at Digita would like to thank you for buying Wordworth 5, the premier Word Processing package for the Amiga.'
  133. NewParagraph
  134. Text 'We also publish many other programs on the Amiga - Organiser 2 is a Personal Information Manager (PIM) '
  135. Text 'which helps you keep organised. Datastore 2 is a flat-file Database program which you can use to store '
  136. Text 'any type of information, for example a database of clients and their addresses, or your CD collection. '
  137. Text 'Money Matters 4 is a personal finance program for keeping track of your accounts. We also distribute the '
  138. Text 'English versions of Personal Paint 6.4, a powerful painting and image processing package, and TurboCalc 3.5, '
  139. Text 'a Spreadsheet program.'
  140. Paragraph 0 0 0 LEFT AUTO SINGLE NONE NONE
  141. NewParagraph
  142. NewParagraph
  143. Text 'Best regards,'
  144. NewParagraph
  145. NewParagraph
  146. NewParagraph
  147. NewParagraph
  148. NewParagraph
  149. Text 'Jeremy Rihll'
  150. NewParagraph
  151. Text 'Director.'
  152. Newparagraph
  153.  
  154. WizardReq TITLE "Mail Merge Wizard" LABEL "Now we'll mail merge this document" LABEL "with the data file we created earlier." BUTTON 1 "_OK" BUTTON "-1" "_Cancel"
  155. If Result = -1 THEN DO
  156.     Close FORCE
  157.     Exit
  158. END
  159.  
  160. MailMerge DATASTORE HEADER DATAFILE "MergeData"
  161.  
  162. WizardReq TITLE "Mail Merge Wizard" LABEL "That's it!" LABEL "" LABEL "Now try creating your own" LABEL "Mail merge documents." BUTTON 1 "_OK" BUTTON "-1" "_Cancel"
  163. If Result = -1 THEN DO
  164.     Close FORCE
  165.     Exit
  166. END
  167.  
  168. Close FORCE
  169.