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

  1. /*    Create_A_Fax_Template
  2.  
  3.         Digita Wizard Script for Wordworth 5
  4.         Copyright ©1996, Digita International Ltd.
  5.         
  6.         Created: 19 January 1996
  7.         Author:  DP
  8. */
  9.  
  10.  
  11. OPTIONS FailAt 100
  12. OPTIONS RESULTS
  13.  
  14. /* Default parameters */
  15. faxname = "Liz Oaten"
  16. position = "Sales Manager"
  17. email = "sales@digita.demon.co.uk"
  18. company = "Digita International Ltd."
  19. address1 = "Black Horse House"
  20. address2 = "Exmouth"
  21. address3 = "Devon"
  22. postcode = "EX8 1JL"
  23. country = "England"
  24. telephone = "01 395 270 273"
  25. facsimile = "01 395 268 893"
  26.  
  27. sendname = "Sender's Name"
  28. sendposition = "sender's postion"
  29.  
  30. recname = "Recipient's Name"
  31. reccompany = "recipient's company"
  32. rectelephone = "recipient's phone"
  33. recfacsimile = "recipient's fax"
  34.  
  35. templatetype = "plain"
  36. templatename = "WizardFaxTemplate"
  37.  
  38. /* Default contents */
  39. deffaxname = ""
  40. defposition = ""
  41. defemail = ""
  42. defcompany = ""
  43. defaddress1 = ""
  44. defaddress2 = ""
  45. defaddress3 = ""
  46. defpostcode = ""
  47. defcountry = ""
  48. deftelephone = ""
  49. deffacsimile = ""
  50.  
  51. defsendname = ""
  52. defsendposition = ""
  53.  
  54. defrecname = ""
  55. defreccompany = ""
  56. defrectelephone = ""
  57. defrecfacsimile = ""
  58.  
  59. deftemplatename = ""
  60.  
  61.  
  62. /* Start */
  63. START:
  64. WizardReq TITLE "Fax Template Wizard" LABEL "This Wizard will create a Fax template which can then be" LABEL "used with the New command (Project menu)." LABEL " Click Next or press Enter to continue to the next step" LABEL " click Previous to return to the previous step, if available" LABEL " click Cancel to quit without creating a fax or" LABEL " click Finish to create a fax using the default parameters." BUTTON 1 "_Next" BUTTON 3 "_Finish" BUTTON "-1" "_Cancel"
  65. if (Result = -1) THEN
  66.     EXIT
  67. if (Result = 3) THEN
  68.     SIGNAL FINISH    
  69.  
  70.  
  71. /* Step 1 */
  72. STEP1:
  73. WizardReq TITLE "Fax Template Wizard" LABEL "What type of facsimile template would you like to produce." LABEL "" LABEL " Click Plain to produce a normal facsimile template," LABEL " Click Stylish to create a fancy looking facsimile." BUTTON 1 "P_lain" BUTTON 2 "_Stylish" BUTTON 3 "_Previous" BUTTON 4 "_Finish" BUTTON "-1" "_Cancel"
  74. if (Result = "-1") THEN
  75.     EXIT
  76. if (Result = 1) THEN DO
  77.     templatetype = "plain"
  78.     SIGNAL STEP2
  79.     END
  80. if (Result = 2) THEN
  81.  DO
  82.     templatetype = "stylish"
  83.     SIGNAL STEP2
  84.     END
  85. if (Result = 3) THEN
  86.     SIGNAL START
  87. if (Result = 4) THEN
  88.     SIGNAL FINISH    
  89.  
  90.  
  91. /* Step 2 */
  92. STEP2:
  93. WizardReq TITLE "Fax Template Wizard" LABEL "Please type in your personal details:" TEXTBOX 1 "N_ame:" CONTENTS deffaxname TEXTBOX 2 "P_osition:" CONTENTS defposition TEXTBOX 3 "_E-mail:" CONTENTS defemail BUTTON 1 "_Next" BUTTON 2 "_Previous" BUTTON 3 "_Finish" BUTTON "-1" "_Cancel"
  94. buttonresult = Result
  95. if (buttonresult = -1) THEN
  96.     EXIT
  97. if (buttonresult = 2) THEN
  98.     SIGNAL STEP1
  99. /* Get and store results */
  100. Wizard_GetTextBox 1
  101. faxname = Result
  102. IF faxname = "" THEN
  103.     faxname = sendname
  104. Wizard_GetTextBox 2
  105. position = Result
  106. IF position = "" THEN
  107.     position = sendposition
  108. Wizard_GetTextBox 3
  109. email = Result
  110. if (buttonresult = 3) THEN
  111.     SIGNAL FINISH    
  112.  
  113.  
  114. /* Step 3 */
  115. STEP3:
  116. WizardReq TITLE "Fax Template Wizard" LABEL "Please type in your address:" TEXTBOX 1 "Compan_y:" CONTENTS defcompany TEXTBOX 2 "Address _1:" CONTENTS defaddress1 TEXTBOX 3 "Address _2:" CONTENTS defaddress2 TEXTBOX 4 "Address _3:" CONTENTS defaddress3 TEXTBOX 5 "P_ost Code:" CONTENTS defpostcode TEXTBOX 6 "Count_ry:" CONTENTS defcountry TEXTBOX 7 "_Telephone:" CONTENTS deftelephone TEXTBOX 8 "Fac_simile:" CONTENTS deffacsimile BUTTON 1 "_Next" BUTTON 2 "_Previous" BUTTON 3 "_Finish" BUTTON "-1" "_Cancel"
  117. buttonresult = Result
  118. if (buttonresult = -1) THEN
  119.     EXIT
  120. if (buttonresult = 2) THEN DO
  121.     deffaxname = faxname
  122.     defposition = position
  123.     defemail = email
  124.     SIGNAL STEP2
  125.     END
  126. /* Get and store results */
  127. Wizard_GetTextBox 1
  128. company = Result
  129. Wizard_GetTextBox 2
  130. address1 = Result
  131. Wizard_GetTextBox 3
  132. address2 = Result
  133. Wizard_GetTextBox 4
  134. address3 = Result
  135. Wizard_GetTextBox 5
  136. postcode = Result
  137. Wizard_GetTextBox 6
  138. country = Result
  139. Wizard_GetTextBox 7
  140. telephone = Result
  141. Wizard_GetTextBox 8
  142. facsimile = Result
  143. if (buttonresult = 3) THEN
  144.     SIGNAL FINISH    
  145.  
  146.  
  147. /* Step 4 */
  148. STEP4:
  149. WizardReq TITLE "Fax Template Wizard" LABEL "Please type in the details of the fax recipient:" TEXTBOX 1 "N_ame:" CONTENTS defrecname TEXTBOX 2 "C_ompany:" CONTENTS defreccompany TEXTBOX 3 "_Telephone:" CONTENTS defrectelephone TEXTBOX 4 "Fac_simile:" CONTENTS defrecfacsimile BUTTON 1 "_Next" BUTTON 2 "_Previous" BUTTON 3 "_Finish" BUTTON "-1" "_Cancel"
  150. buttonresult = Result
  151. if (buttonresult = -1) THEN
  152.     EXIT
  153. if (buttonresult = 2) THEN DO
  154.     defcompany = company
  155.     defaddress1 = address1
  156.     defaddress2 = address2
  157.     defaddress3 = address3
  158.     defpostcode = postcode
  159.     defcountry = country
  160.     deftelephone = telephone
  161.     deffacsimile = facsimile
  162.     SIGNAL STEP3
  163.     END
  164. /* Get and store results */
  165. Wizard_GetTextBox 1
  166. IF Result ~= "" THEN
  167.     recname = Result
  168. Wizard_GetTextBox 2
  169. IF Result ~= "" THEN
  170.     reccompany = Result
  171. Wizard_GetTextBox 3
  172. IF Result ~= "" THEN
  173.     rectelephone = Result
  174. Wizard_GetTextBox 4
  175. IF Result ~= "" THEN
  176.     recfacsimile = Result
  177. if (buttonresult = 3) THEN
  178.     SIGNAL FINISH    
  179.  
  180.  
  181. /* Step 5 */
  182. STEP5:
  183. WizardReq TITLE "Fax Template Wizard" LABEL "Please type in the name that you would" LABEL "like to give the template:" TEXTBOX 1 "Template N_ame:" CONTENTS deftemplatename BUTTON 1 "_Next" BUTTON 2 "_Previous" BUTTON 3 "_Finish" BUTTON "-1" "_Cancel"
  184. buttonresult = Result
  185. if (buttonresult = -1) THEN
  186.     EXIT
  187. if (buttonresult = 2) THEN DO
  188.     defrecname = recname
  189.     defreccompany = reccompany
  190.     defrectelephone = rectelephone
  191.     defrecfacsimile = recfacsimile
  192.     SIGNAL STEP4
  193.     END
  194. /* Get and store results */
  195. Wizard_GetTextBox 1
  196. IF Result ~= "" THEN
  197.     templatename = Result
  198. if (buttonresult = 3) THEN
  199.     SIGNAL FINISH
  200.  
  201.  
  202. /* Finished */
  203. WizardReq TITLE "Fax Template Wizard - Creating" LABEL "The Fax template is finished requesting information from you." LABEL "" LABEL "Click Finish to create your fax template and save it to disk" LABEL "for future use." LABEL "" LABEL "Note: The creation of the fax may take a short while." BUTTON 1 "_Finish" BUTTON 2 "_Previous" BUTTON "-1" "_Cancel"
  204. if (Result = -1) THEN
  205.     EXIT
  206. if (Result = 2) THEN DO
  207.     deftemplatename = templatename
  208.     SIGNAL STEP5
  209.     END
  210. if (Result = 1) THEN
  211.     SIGNAL FINISH    
  212.  
  213.  
  214. FINISH:
  215. /* Create New document and set up margins */
  216. New
  217. faxportname = Result
  218. ADDRESS VALUE faxportname
  219. Document A4 "0.5in" "0.5in" "0.5in"
  220.  
  221. if (templatetype = "plain") THEN DO
  222.     /* Create 'plain' fax template */
  223.     Font NAME "Shannon Book"
  224.     Font SIZE "20" BOLD WIDTH 600
  225.     LeftJustify
  226.     Text "Facsimile"
  227.     Font SIZE "10" WIDTH 100
  228.     NewParagraph
  229.     NewParagraph
  230.  
  231.     SetTab LEFT "4cm"
  232.  
  233.     Font BOLD ITALIC
  234.     Text "FROM:"
  235.     Font PLAIN
  236.     NewParagraph
  237.     if faxname ~= "" THEN DO
  238.         Text "Name:    "
  239.         Text faxname
  240.         NewParagraph
  241.         END
  242.     if position ~= "" THEN DO
  243.         Text "Position:    "
  244.         Text position
  245.         NewParagraph
  246.         END
  247.     if company ~= "" THEN DO
  248.         Text "Company:    "
  249.         Text company
  250.         NewParagraph
  251.         END
  252.     if address1 ~= "" THEN DO
  253.         Text "Address:    "
  254.         Text address1
  255.         NewParagraph
  256.         END
  257.     if address2 ~= "" THEN DO
  258.         Text "    "
  259.         Text address2
  260.         NewParagraph
  261.         END
  262.     if address3 ~= "" THEN DO
  263.         Text "    "
  264.         Text address3
  265.         NewParagraph
  266.         END
  267.     if postcode ~= "" THEN DO
  268.         Text "    "
  269.         Text postcode
  270.         NewParagraph
  271.         END
  272.     if country ~= "" THEN DO
  273.         Text "    "
  274.         Text country
  275.         NewParagraph
  276.         END
  277.     if telephone ~= "" THEN DO
  278.         Text "Telephone:    "
  279.         Text telephone
  280.         NewParagraph
  281.         END
  282.     if facsimile ~= "" THEN DO
  283.         Text "Facsimile:    "
  284.         Text facsimile
  285.         NewParagraph
  286.         END
  287.     if email ~= "" THEN DO
  288.         Text "E-mail:    "
  289.         Text email
  290.         NewParagraph
  291.         END
  292.  
  293.     NewParagraph
  294.     Font BOLD ITALIC
  295.     Text "TO:"
  296.     Font PLAIN
  297.     NewParagraph
  298.     Text "Name:    "
  299.     Text recname
  300.     NewParagraph
  301.     if reccompany ~= "" THEN DO
  302.         Text "Company:    "
  303.         Text reccompany
  304.         NewParagraph
  305.         END
  306.     Text "Telephone:    "
  307.     Text rectelephone
  308.     NewParagraph
  309.     Text "Facsimile:    "
  310.     Text recfacsimile
  311.     NewParagraph
  312.     NewParagraph
  313.     Text "Date:    "
  314.     InsertUpdatingDate
  315.     NewParagraph
  316.     Text "Pages:      (including this one)"
  317.     NewParagraph
  318.     NewParagraph
  319.     END
  320.  
  321. if (templatetype = "stylish") THEN DO
  322.     /* Create 'stylish' fax template */
  323.     Font NAME "Shannon Book"
  324.     Font SIZE "20" BOLD WIDTH 600
  325.     CentreJustify
  326.     Text "Facsimile"
  327.     Font SIZE "10" PLAIN WIDTH 100
  328.     NewParagraph
  329.     NewParagraph
  330.     if company ~= "" THEN DO
  331.         Text company
  332.         Text "   "
  333.         END
  334.     if address1 ~= "" THEN DO
  335.         Text address1
  336.         Text "   "
  337.         END
  338.     if address2 ~= "" THEN DO
  339.         Text address2
  340.         Text "   "
  341.         END
  342.     if address3 ~= "" THEN DO
  343.         Text address3
  344.         Text "   "
  345.         END
  346.     if postcode ~= "" THEN DO
  347.         Text postcode
  348.         Text "   "
  349.         END
  350.     if country ~= "" THEN DO
  351.         Text country
  352.         END
  353.     NewParagraph
  354.     Font ITALIC
  355.     if telephone ~= "" THEN DO
  356.         Text "Telephone: "
  357.         Text telephone
  358.         END
  359.     if facsimile ~= "" THEN DO
  360.         Text "   "
  361.         Text "Facsimile: "
  362.         Text facsimile
  363.         END
  364.     if email ~= "" THEN DO
  365.         Text "   "
  366.         Text "E-mail: "
  367.         Text email
  368.         END
  369.     
  370.     Font PLAIN
  371.     NewParagraph
  372.     
  373.     LeftJustify
  374.     NewParagraph
  375.     NewParagraph
  376.     
  377.     SetTab RIGHT "4cm"
  378.     SetTab LEFT "4.5cm"
  379.     SetTab LEFT "10cm"
  380.     SetTab RIGHT "13cm"
  381.     SetTab LEFT "13.5cm"
  382.     Font BOLD
  383.     Text "TO"
  384.     Font PLAIN
  385.     Text "    Name:    "
  386.     Font SMALLCAPS
  387.     Text recname
  388.     Font SMALLCAPS
  389.     Text "    "
  390.     Font BOLD
  391.     Text "FROM"
  392.     Font PLAIN
  393.     Text "    Name:    "
  394.     Font SMALLCAPS
  395.     Text faxname
  396.     Font SMALLCAPS
  397.     NewParagraph
  398.     
  399.     Text "    Company:    "
  400.     Text reccompany
  401.     Text "        "
  402.     Text "Position:    "
  403.     Text position
  404.     NewParagraph
  405.     
  406.     Text "    Telephone:    "
  407.     Text rectelephone
  408.     Text "        "
  409.     Text "Date:    "
  410.     InsertUpdatingDate
  411.     NewParagraph
  412.     
  413.     Text "    Facsimile:    "
  414.     Text recfacsimile
  415.     Text "        "
  416.     Text "Pages:    "
  417.     NewParagraph
  418.     NewParagraph
  419.     
  420.     DrawLine 1 "2.54cm" "6.35cm" "18.5cm" "6.35cm" 2 "60% Grey"
  421.     END
  422.  
  423.  
  424. /* Go to main page */
  425. CtrlDown
  426. NewParagraph
  427.  
  428. SAVEAS TEMPLATE NAME templatename
  429.  
  430. RequestNotify PROMPT "The Fax Template Wizard has finished."
  431. End
  432.